Fix PR53476

Message ID alpine.LNX.2.00.1212131616030.14089@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener Dec. 13, 2012, 3:17 p.m.
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.


2012-12-13  Richard Biener  <>

	PR middle-end/53476
	* varpool.c (varpool_remove_unreferenced_decls): Revert to 4.7


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)