diff options
author | Richard Biener <rguenther@suse.de> | 2016-10-07 07:47:38 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-10-07 07:47:38 +0000 |
commit | 014b59e68837b998593b03b5eab3f7ff707d5d69 (patch) | |
tree | f6783945ed05f2cbb9270992b43531d56a3a99ab /gcc/gimple-low.c | |
parent | 4023bc5647c3c76ff70ad7efb6db6f5db781016e (diff) | |
download | gcc-014b59e68837b998593b03b5eab3f7ff707d5d69.zip gcc-014b59e68837b998593b03b5eab3f7ff707d5d69.tar.gz gcc-014b59e68837b998593b03b5eab3f7ff707d5d69.tar.bz2 |
gimple-low.c (lower_gimple_bind): Clear DECL_CHAIN of vars in gimple_bind_vars but not in BLOCK_VARS.
2016-10-07 Richard Biener <rguenther@suse.de>
* gimple-low.c (lower_gimple_bind): Clear DECL_CHAIN of
vars in gimple_bind_vars but not in BLOCK_VARS.
From-SVN: r240855
Diffstat (limited to 'gcc/gimple-low.c')
-rw-r--r-- | gcc/gimple-low.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c index 5f3361a..1bccf44 100644 --- a/gcc/gimple-low.c +++ b/gcc/gimple-low.c @@ -416,6 +416,23 @@ lower_gimple_bind (gimple_stmt_iterator *gsi, struct lower_data *data) } record_vars (gimple_bind_vars (stmt)); + + /* Scrap DECL_CHAIN up to BLOCK_VARS to ease GC after we no longer + need gimple_bind_vars. */ + tree next; + tree end = NULL_TREE; + if (gimple_bind_block (stmt)) + end = BLOCK_VARS (gimple_bind_block (stmt)); + for (tree var = gimple_bind_vars (stmt); var != end; 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; + } + lower_sequence (gimple_bind_body_ptr (stmt), data); if (new_block) |