aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-03-06 23:49:39 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2009-03-06 23:49:39 +0100
commit9f0e7885bb87904aac629a6c9aa3df4156667c08 (patch)
tree645eb9edc055f339bd8caceb0c87f633d148625c /gcc/tree-cfg.c
parent3b664bd1dab8cf90edd168913e8bf50bb262343a (diff)
downloadgcc-9f0e7885bb87904aac629a6c9aa3df4156667c08.zip
gcc-9f0e7885bb87904aac629a6c9aa3df4156667c08.tar.gz
gcc-9f0e7885bb87904aac629a6c9aa3df4156667c08.tar.bz2
re PR debug/39372 (Missing DW_AT_location for constructor static variable)
PR debug/39372 * dwarf2out.c (add_abstract_origin_attribute): Return origin_die. (gen_variable_die): Emit DW_AT_location on abstract static variable's DIE, don't emit it if abstract origin already has it. * tree-cfg.c (remove_useless_stmts_bind): GIMPLE_BINDs with any BLOCK_NONLOCALIZED_VARS in its gimple_bind_block aren't useless. * g++.dg/debug/dwarf2/static-local-var-in-ctor.C: New test. From-SVN: r144682
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 440aa93..9c5b2e6 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -1799,11 +1799,11 @@ remove_useless_stmts_bind (gimple_stmt_iterator *gsi, struct rus_data *data ATTR
tree var = NULL_TREE;
/* Even if there are no gimple_bind_vars, there might be other
decls in BLOCK_VARS rendering the GIMPLE_BIND not useless. */
- if (block)
+ if (block && !BLOCK_NUM_NONLOCALIZED_VARS (block))
for (var = BLOCK_VARS (block); var; var = TREE_CHAIN (var))
if (TREE_CODE (var) == IMPORTED_DECL)
break;
- if (var)
+ if (var || (block && BLOCK_NUM_NONLOCALIZED_VARS (block)))
gsi_next (gsi);
else
{