This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/63255] [5.0 regression] FAIL: gcc.dg/lto/ipareference2 c_lto_ipareference2_0.o-c_lto_ipareference2_1.o execute -O1 -flto -flto-partition=1to1 -fwhole-program


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]