diff options
author | Richard Biener <rguenther@suse.de> | 2016-10-11 12:52:44 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-10-11 12:52:44 +0000 |
commit | b13ff1f5e247e074631f9dcf2fd25f9b683016f5 (patch) | |
tree | 7b929b3c56ec12c21fddad7dfe7a765a29a5f39c /gcc/gimple-low.c | |
parent | 1d0eabee39af26125889437d3b796c6c2e68449f (diff) | |
download | gcc-b13ff1f5e247e074631f9dcf2fd25f9b683016f5.zip gcc-b13ff1f5e247e074631f9dcf2fd25f9b683016f5.tar.gz gcc-b13ff1f5e247e074631f9dcf2fd25f9b683016f5.tar.bz2 |
re PR debug/77931 (PASS->FAIL: gdb.cp/namespace.exp: print ina)
2016-10-11 Richard Biener <rguenther@suse.de>
PR debug/77931
* gimple-low.c (lower_gimple_bind): Handle arbitrary common
sub-chains of BLOCK_VARS and gimple_bind_vars.
From-SVN: r240991
Diffstat (limited to 'gcc/gimple-low.c')
-rw-r--r-- | gcc/gimple-low.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c index 8e98762..64752b6 100644 --- a/gcc/gimple-low.c +++ b/gcc/gimple-low.c @@ -420,18 +420,21 @@ lower_gimple_bind (gimple_stmt_iterator *gsi, struct lower_data *data) /* Scrap DECL_CHAIN up to BLOCK_VARS to ease GC after we no longer need gimple_bind_vars. */ tree next; - tree end = NULL_TREE; + /* BLOCK_VARS and gimple_bind_vars share a common sub-chain. Find + it by marking all BLOCK_VARS. */ if (gimple_bind_block (stmt)) - end = BLOCK_VARS (gimple_bind_block (stmt)); - for (tree var = gimple_bind_vars (stmt); var != end; var = next) + for (tree t = BLOCK_VARS (gimple_bind_block (stmt)); t; t = DECL_CHAIN (t)) + TREE_VISITED (t) = 1; + for (tree var = gimple_bind_vars (stmt); + var && ! TREE_VISITED (var); var = next) { - /* Ugh, something is violating the constraint that BLOCK_VARS - is a sub-chain of gimple_bind_vars. */ - if (! var) - break; next = DECL_CHAIN (var); DECL_CHAIN (var) = NULL_TREE; } + /* Unmark BLOCK_VARS. */ + if (gimple_bind_block (stmt)) + for (tree t = BLOCK_VARS (gimple_bind_block (stmt)); t; t = DECL_CHAIN (t)) + TREE_VISITED (t) = 0; lower_sequence (gimple_bind_body_ptr (stmt), data); |