diff options
author | Richard Guenther <rguenther@suse.de> | 2007-09-06 09:05:58 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2007-09-06 09:05:58 +0000 |
commit | 515f36ebd9df15ba503f02dbc77a32183ec03664 (patch) | |
tree | dad0e8d38805913fe334995e506eaac1d8d4144d /gcc | |
parent | 47de45c6fc7adcf626af5499cb39b0ca43b870c3 (diff) | |
download | gcc-515f36ebd9df15ba503f02dbc77a32183ec03664.zip gcc-515f36ebd9df15ba503f02dbc77a32183ec03664.tar.gz gcc-515f36ebd9df15ba503f02dbc77a32183ec03664.tar.bz2 |
re PR tree-optimization/33302 (dead-store not eliminated)
2007-09-06 Richard Guenther <rguenther@suse.de>
PR tree-optimization/33302
* tree-ssa-dse.c (tree_ssa_dse): Connect infinite loops
to the exit block before doing the post-dominator walk.
* domwalk.c (walk_dominator_tree): The exit block is
interesting even if it is not reachable.
* gcc.dg/tree-ssa/ssa-dse-11.c: New testcase.
From-SVN: r128180
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/domwalk.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-11.c | 21 |
4 files changed, 35 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 55694f0..39caec6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-09-06 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/33302 + * domwalk.c (walk_dominator_tree): The exit block is + interesting even if it is not reachable. + 2007-09-06 Richard Sandiford <richard@codesourcery.com> PR middle-end/33306 diff --git a/gcc/domwalk.c b/gcc/domwalk.c index a58437e..fb7f072 100644 --- a/gcc/domwalk.c +++ b/gcc/domwalk.c @@ -151,7 +151,9 @@ walk_dominator_tree (struct dom_walk_data *walk_data, basic_block bb) while (true) { /* Don't worry about unreachable blocks. */ - if (EDGE_COUNT (bb->preds) > 0 || bb == ENTRY_BLOCK_PTR) + if (EDGE_COUNT (bb->preds) > 0 + || bb == ENTRY_BLOCK_PTR + || bb == EXIT_BLOCK_PTR) { /* If block BB is not interesting to the caller, then none of the callbacks that walk the statements in BB are going to be diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c48beda..c6bb8f8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-09-06 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/33302 + * gcc.dg/tree-ssa/ssa-dse-11.c: New testcase. + 2007-09-06 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/33225 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-11.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-11.c new file mode 100644 index 0000000..bd66bc2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-11.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-dse1-details" } */ + +extern void abort(void); +void foo(int *p) +{ + while (1) + { + *p = 0; + *p = 0; + } +} +void bar(int *p) +{ + *p = 0; + *p = 0; + abort (); +} + +/* { dg-final { scan-tree-dump-times "Deleted dead store" 2 "dse1" } } */ +/* { dg-final { cleanup-tree-dump "dse1" } } */ |