This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix ipareference-1 testcase
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 20 Sep 2014 04:59:56 +0200
- Subject: Fix ipareference-1 testcase
- Authentication-results: sourceware.org; auth=none
Hi,
this patch fixes ordering issue that prevents ipa-reference folding with LTO
Bootstrapped/regtested x86_64-linux, comitted.
Honza
PR tree-optimization/63255
* ipa.c (symbol_table::remove_unreachable_nodes): Fix ordering
issue in setting body_removed flag.
Index: ipa.c
===================================================================
--- ipa.c (revision 215409)
+++ 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