OSDN Git Service

2009-10-13 Steve Ellcey <sje@cup.hp.com>
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-live.c
index a710c65..6d2fb32 100644 (file)
@@ -637,6 +637,15 @@ dump_scope_block (FILE *file, int indent, tree scope, int flags)
   fprintf (file, "\n%*s}\n",indent, "");
 }
 
+/* Dump the tree of lexical scopes starting at SCOPE to stderr.  FLAGS
+   is as in print_generic_expr.  */
+
+void
+debug_scope_block (tree scope, int flags)
+{
+  dump_scope_block (stderr, 0, scope, flags);
+}
+
 
 /* Dump the tree of lexical scopes of current_function_decl to FILE.
    FLAGS is as in print_generic_expr.  */
@@ -694,6 +703,9 @@ remove_unused_locals (void)
          gimple stmt = gsi_stmt (gsi);
          tree b = gimple_block (stmt);
 
+         if (is_gimple_debug (stmt))
+           continue;
+
          if (b)
            TREE_USED (b) = true;
 
@@ -795,6 +807,7 @@ remove_unused_locals (void)
        && TREE_CODE (t) != PARM_DECL
        && TREE_CODE (t) != RESULT_DECL
        && !(ann = var_ann (t))->used
+       && !ann->is_heapvar
        && !TREE_ADDRESSABLE (t))
       remove_referenced_var (t);
   remove_unused_scope_block_p (DECL_INITIAL (current_function_decl));
@@ -978,6 +991,8 @@ set_var_live_on_entry (tree ssa_name, tree_live_info_p live)
                add_block = e->src;
            }
        }
+      else if (is_gimple_debug (use_stmt))
+       continue;
       else
         {
          /* If its not defined in this block, its live on entry.  */