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

--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
This is ordering issue in node removal (there is code to read constructor from
file before removing the symbol for symbol table, but it is executed after the
symbol is marked removed).  I am testing:
Index: ipa.c
===================================================================
--- ipa.c       (revision 215403)
+++ ipa.c       (working copy)
@@ -538,6 +538,11 @@
                fprintf (file, " %s", vnode->name ());
              changed = true;
            }
+         /* Keep body if it may be useful for constant folding.  */
+         if ((init = ctor_for_folding (vnode->decl)) == error_mark_node)
+           vnode->remove_initializer ();
+         else
+           DECL_INITIAL (vnode->decl) = init;
          vnode->body_removed = true;
          vnode->definition = false;
          vnode->analyzed = false;
@@ -545,11 +550,6 @@

          vnode->remove_from_same_comdat_group ();

-         /* Keep body if it may be useful for constant folding.  */
-         if ((init = ctor_for_folding (vnode->decl)) == error_mark_node)
-           vnode->remove_initializer ();
-         else
-           DECL_INITIAL (vnode->decl) = init;
          vnode->remove_all_references ();
        }
       else

Reply via email to