Avoid segfault when dumping IPA-CP lattices for unoptimized functions (PR 92917)
authorMartin Jambor <mjambor@suse.cz>
Fri, 3 Jan 2020 13:52:38 +0000 (14:52 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Fri, 3 Jan 2020 13:52:38 +0000 (14:52 +0100)
2020-01-03  Martin Jambor  <mjambor@suse.cz>

PR ipa/92917
* ipa-cp.c (print_all_lattices): Skip functions without info.

From-SVN: r279859

gcc/ChangeLog
gcc/ipa-cp.c

index 8cbaa45d7b315da4726fdab6117c00bda12ea654..82c25d9b5256dbf1f10b76895912f58e9d88bded 100644 (file)
@@ -1,3 +1,8 @@
+2020-01-03  Martin Jambor  <mjambor@suse.cz>
+
+       PR ipa/92917
+       * ipa-cp.c (print_all_lattices): Skip functions without info.
+
 2020-01-03  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/93089
index 43c0d5a670664b56eb1a2281408136851a0d8a15..4381b35a8095787b10213209371575b5f4c2892d 100644 (file)
@@ -543,8 +543,9 @@ print_all_lattices (FILE * f, bool dump_sources, bool dump_benefits)
       class ipa_node_params *info;
 
       info = IPA_NODE_REF (node);
-      /* Skip constprop clones since we don't make lattices for them.  */
-      if (info->ipcp_orig_node)
+      /* Skip unoptimized functions and constprop clones since we don't make
+        lattices for them.  */
+      if (!info || info->ipcp_orig_node)
        continue;
       fprintf (f, "  Node: %s:\n", node->dump_name ());
       count = ipa_get_param_count (info);