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  <rguent...@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)));
 }
 

Reply via email to