https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105415

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Wonder about:
--- gcc/alias.cc.jj     2022-02-21 16:51:50.261232505 +0100
+++ gcc/alias.cc        2022-04-28 11:57:18.940425126 +0200
@@ -2219,8 +2219,10 @@ compare_base_symbol_refs (const_rtx x_ba
          || (!TREE_STATIC (x_decl) && !TREE_PUBLIC (x_decl)))
        return 0;

-      symtab_node *x_node = symtab_node::get_create (x_decl)
-                           ->ultimate_alias_target ();
+      symtab_node *x_node = symtab_node::get (x_decl);
+      if (x_node == NULL)
+       return 0;
+      x_node = x_node->ultimate_alias_target ();
       /* External variable cannot be in section anchor.  */
       if (!x_node->definition)
        return 0;
It would surprise me if we needed to create varpool nodes so late, if they
don't exist, with the exception of DEBUG_INSNs referencing already removed
symbols I don't see the reason why the varpool nodes wouldn't be present.
Another option would be for the x_node == NULL case to use x_decl rather than
x_node->decl, i.e. just assume x_decl isn't an alias if it doesn't have a
varpool node.

Reply via email to