This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[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
- From: "hubicka at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 19 Sep 2014 21:37:57 +0000
- Subject: [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
- Auto-submitted: auto-generated
- References: <bug-63255-4 at http dot gcc dot gnu dot org/bugzilla/>
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