This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR53476
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jan Hubicka <jh at suse dot de>
- Date: Thu, 13 Dec 2012 16:17:43 +0100 (CET)
- Subject: [PATCH] Fix PR53476
This fixes the weak alias regression FAIL: gcc.dg/attr-weakref-1.c.
I tracked it down to the fact that this has both DECL_EXTERNAL
and TREE_STATIC (and RTL) set but the trunk code differs from the
4.7 code in that it has an additional !DECL_EXTERNAL check
(for no apparent reason, that is, no testcase or comment).
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.
Richard.
2012-12-13 Richard Biener <rguenther@suse.de>
PR middle-end/53476
* varpool.c (varpool_remove_unreferenced_decls): Revert to 4.7
behavior.
Index: gcc/varpool.c
===================================================================
--- gcc/varpool.c (revision 194473)
+++ gcc/varpool.c (working copy)
@@ -358,8 +358,7 @@ varpool_remove_unreferenced_decls (void)
&& (!varpool_can_remove_if_no_refs (node)
/* We just expanded all function bodies. See if any of
them needed the variable. */
- || (!DECL_EXTERNAL (node->symbol.decl)
- && DECL_RTL_SET_P (node->symbol.decl))))
+ || DECL_RTL_SET_P (node->symbol.decl)))
{
enqueue_node (node, &first);
if (cgraph_dump_file)