Fix ICE during dumping in ipa-modref.
authorJan Hubicka <jh@suse.cz>
Sun, 20 Sep 2020 06:19:56 +0000 (08:19 +0200)
committerJan Hubicka <jh@suse.cz>
Sun, 20 Sep 2020 06:19:56 +0000 (08:19 +0200)
2020-09-20  Jan Hubicka  <hubicka@ucw.cz>

* ipa-modref.c (dump_lto_records): Fix ICE.

gcc/ipa-modref.c

index f982ce9..af0b710 100644 (file)
@@ -156,7 +156,7 @@ dump_lto_records (modref_records_lto *tt, FILE *out)
       fprintf (out, "      Base %i:", (int)i);
       print_generic_expr (dump_file, n->base);
       fprintf (out, " (alias set %i)\n",
-              get_alias_set (n->base));
+              n->base ? get_alias_set (n->base) : 0);
       if (n->every_ref)
        {
          fprintf (out, "      Every ref\n");
@@ -169,7 +169,7 @@ dump_lto_records (modref_records_lto *tt, FILE *out)
          fprintf (out, "        Ref %i:", (int)j);
          print_generic_expr (dump_file, r->ref);
          fprintf (out, " (alias set %i)\n",
-                  get_alias_set (r->ref));
+                  r->ref ? get_alias_set (r->ref) : 0);
        }
     }
 }