This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR54534
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 11 Sep 2012 12:39:49 +0200 (CEST)
- Subject: [PATCH] Fix PR54534
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.
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)));
}