diff options
author | Richard Guenther <rguenther@suse.de> | 2008-08-18 15:36:15 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-08-18 15:36:15 +0000 |
commit | e46587281e54e3a8f1eedd70bc322b53cb1fbdcd (patch) | |
tree | 0dbbbb43b073bfe9473ff5176b4bb98c84ecdbed /gcc | |
parent | 5289e80852bb30d7e6afd90ea77ad1ed66d30bc7 (diff) | |
download | gcc-e46587281e54e3a8f1eedd70bc322b53cb1fbdcd.zip gcc-e46587281e54e3a8f1eedd70bc322b53cb1fbdcd.tar.gz gcc-e46587281e54e3a8f1eedd70bc322b53cb1fbdcd.tar.bz2 |
tree-ssa-reassoc.c (reassociate_bb): Properly reset the statement iterator after statement removal.
2008-08-18 Richard Guenther <rguenther@suse.de>
* tree-ssa-reassoc.c (reassociate_bb): Properly reset the
statement iterator after statement removal.
From-SVN: r139201
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree-ssa-reassoc.c | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2f49559..38d137f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-08-18 Richard Guenther <rguenther@suse.de> + + * tree-ssa-reassoc.c (reassociate_bb): Properly reset the + statement iterator after statement removal. + 2008-08-18 Andreas Tobler <a.tobler@schweiz.org> * config/rs6000/driver-rs6000.c (detect_caches_freebsd): New function. diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index be68331..e4e7db6 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -1771,6 +1771,18 @@ reassociate_bb (basic_block bb) { gsi_remove (&gsi, true); release_defs (stmt); + /* We might end up removing the last stmt above which + places the iterator to the end of the sequence. + Reset it to the last stmt in this case which might + be the end of the sequence as well if we removed + the last statement of the sequence. In which case + we need to bail out. */ + if (gsi_end_p (gsi)) + { + gsi = gsi_last_bb (bb); + if (gsi_end_p (gsi)) + break; + } } continue; } |