diff options
author | Jakub Jelinek <jakub@redhat.com> | 2009-03-05 13:50:36 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2009-03-05 13:50:36 +0100 |
commit | ee0ee7e2c1fd52af141b14c0230dcf6cd50c2b35 (patch) | |
tree | 9965c4ee4fa295755fc70e7820216ddf00608b1c /gcc/tree-cfg.c | |
parent | 6c6094f12fae0fe23eb390a115645d78f82a42c1 (diff) | |
download | gcc-ee0ee7e2c1fd52af141b14c0230dcf6cd50c2b35.zip gcc-ee0ee7e2c1fd52af141b14c0230dcf6cd50c2b35.tar.gz gcc-ee0ee7e2c1fd52af141b14c0230dcf6cd50c2b35.tar.bz2 |
re PR debug/39379 (DW_TAG_imported* no longer emitted)
PR debug/39379
* tree-cfg.c (remove_useless_stmts_bind): Don't remove GIMPLE_BINDs
with blocks containing IMPORTED_DECLs in BLOCK_VARS.
* g++.dg/debug/dwarf2/imported-module-3.C: New test.
* g++.dg/debug/dwarf2/imported-module-4.C: New test.
From-SVN: r144640
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 5632a89..440aa93 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -1796,9 +1796,21 @@ remove_useless_stmts_bind (gimple_stmt_iterator *gsi, struct rus_data *data ATTR || (TREE_CODE (BLOCK_ABSTRACT_ORIGIN (block)) != FUNCTION_DECL))) { - gsi_insert_seq_before (gsi, body_seq, GSI_SAME_STMT); - gsi_remove (gsi, false); - data->repeat = true; + 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) + for (var = BLOCK_VARS (block); var; var = TREE_CHAIN (var)) + if (TREE_CODE (var) == IMPORTED_DECL) + break; + if (var) + gsi_next (gsi); + else + { + gsi_insert_seq_before (gsi, body_seq, GSI_SAME_STMT); + gsi_remove (gsi, false); + data->repeat = true; + } } else gsi_next (gsi); |