OSDN Git Service

PR debug/39474
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Mar 2009 17:53:01 +0000 (17:53 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Mar 2009 17:53:01 +0000 (17:53 +0000)
* tree-ssa-live.c (remove_unused_locals): Don't remove local
unused non-artificial variables when not optimizing.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144914 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-ssa-live.c

index fae65db..8e5fa32 100644 (file)
@@ -3,6 +3,10 @@
        * dwarf2out.c (dwarf2out_imported_module_or_decl_1): Allow
        non-NAMESPACE_DECL IMPORTED_DECL_ASSOCIATED_DECL.
 
        * dwarf2out.c (dwarf2out_imported_module_or_decl_1): Allow
        non-NAMESPACE_DECL IMPORTED_DECL_ASSOCIATED_DECL.
 
+       PR debug/39474
+       * tree-ssa-live.c (remove_unused_locals): Don't remove local
+       unused non-artificial variables when not optimizing.
+
        PR debug/39471
        * dwarf2out.c (dwarf2out_imported_module_or_decl_1): Emit
        DW_TAG_imported_module even if decl is IMPORTED_DECL with
        PR debug/39471
        * dwarf2out.c (dwarf2out_imported_module_or_decl_1): Emit
        DW_TAG_imported_module even if decl is IMPORTED_DECL with
index 28a829c..5731964 100644 (file)
@@ -740,7 +740,8 @@ remove_unused_locals (void)
 
       if (TREE_CODE (var) != FUNCTION_DECL
          && (!(ann = var_ann (var))
 
       if (TREE_CODE (var) != FUNCTION_DECL
          && (!(ann = var_ann (var))
-             || !ann->used))
+             || !ann->used)
+         && (optimize || DECL_ARTIFICIAL (var)))
        {
          if (is_global_var (var))
            {
        {
          if (is_global_var (var))
            {
@@ -781,8 +782,7 @@ remove_unused_locals (void)
 
          if (TREE_CODE (var) == VAR_DECL
              && is_global_var (var)
 
          if (TREE_CODE (var) == VAR_DECL
              && is_global_var (var)
-             && bitmap_bit_p (global_unused_vars, DECL_UID (var))
-             && (optimize || DECL_ARTIFICIAL (var)))
+             && bitmap_bit_p (global_unused_vars, DECL_UID (var)))
            *cell = TREE_CHAIN (*cell);
          else
            cell = &TREE_CHAIN (*cell);
            *cell = TREE_CHAIN (*cell);
          else
            cell = &TREE_CHAIN (*cell);