Patchwork Fix PR54534

login
register
mail settings
Submitter Richard Guenther
Date Sept. 11, 2012, 10:39 a.m.
Message ID <alpine.LNX.2.00.1209111238300.28649@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/183077/
State New
Headers show

Comments

Richard Guenther - Sept. 11, 2012, 10:39 a.m.
The backport of the patch for PR53572 caused us to remove unused
decls at -O0, a regresion on the branch - fixed by the following.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2012-09-11  Richard Guenther  <rguenther@suse.de>

	PR debug/54534
	* cgraph.h (varpool_can_remove_if_no_refs): Restore dependence
	on flag_toplevel_reorder.

Patch

Index: gcc/cgraph.h
===================================================================
--- gcc/cgraph.h	(revision 191174)
+++ gcc/cgraph.h	(working copy)
@@ -951,7 +951,7 @@  varpool_can_remove_if_no_refs (struct va
   return (!node->force_output && !node->used_from_other_partition
 	  && ((DECL_COMDAT (node->decl)
 	       && !varpool_used_from_object_file_p (node))
-	      || !node->externally_visible
+	      || (flag_toplevel_reorder && !node->externally_visible)
 	      || DECL_HAS_VALUE_EXPR_P (node->decl)));
 }