aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-live.c
diff options
context:
space:
mode:
authorjakub <>2011-12-01 19:12:54 +0000
committerjakub <>2011-12-01 19:12:54 +0000
commit6126c476cb72151c4871c052db7fe10da6255aa4 (patch)
treea0a8960c1902ff04d8b319d3ba88cf5c4f64534b /gcc/tree-ssa-live.c
parent53d86c197f0e81e9c34b463290bd8e74b49a60f0 (diff)
PR debug/50317
* tree-ssa-dce.c (remove_dead_stmt): Add a debug stmt when removing as unnecessary a store to a variable with gimple reg type. * tree-ssa-live.c (remove_unused_locals): Clear TREE_ADDRESSABLE bit on local unreferenced variables. * cfgexpand.c (expand_gimple_basic_block): Don't emit DEBUG_INSNs for !target_for_debug_bind variables.
Diffstat (limited to 'gcc/tree-ssa-live.c')
-rw-r--r--gcc/tree-ssa-live.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index b8a056ebdac..103e4f7155a 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -1,5 +1,5 @@
/* Liveness for SSA trees.
- Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010
+ Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Andrew MacLeod <amacleod@redhat.com>
@@ -814,7 +814,15 @@ remove_unused_locals (void)
bitmap_set_bit (global_unused_vars, DECL_UID (var));
}
else
- continue;
+ {
+ /* For unreferenced local vars drop TREE_ADDRESSABLE
+ bit in case it is referenced from debug stmts. */
+ if (DECL_CONTEXT (var) == current_function_decl
+ && TREE_ADDRESSABLE (var)
+ && is_gimple_reg_type (TREE_TYPE (var)))
+ TREE_ADDRESSABLE (var) = 0;
+ continue;
+ }
}
else if (TREE_CODE (var) == VAR_DECL
&& DECL_HARD_REGISTER (var)