aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dce.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-10-22 12:45:32 +0200
committerRichard Biener <rguenther@suse.de>2021-10-22 13:42:57 +0200
commitc2a9a98a369528c8689ecb68db576f8e7dc2fa45 (patch)
tree0b65b73e94cd6689eb65207deac539b7c5fdfa55 /gcc/tree-ssa-dce.c
parent8a0faddadd159c19fe79572619ea6466eeed0135 (diff)
downloadgcc-c2a9a98a369528c8689ecb68db576f8e7dc2fa45.zip
gcc-c2a9a98a369528c8689ecb68db576f8e7dc2fa45.tar.gz
gcc-c2a9a98a369528c8689ecb68db576f8e7dc2fa45.tar.bz2
tree-optimization/102893 - properly DCE empty loops inside infinite loops
The following fixes the test for an exit edge I put in place for the fix for PR45178 where I somehow misunderstood how the cyclic list works. 2021-10-22 Richard Biener <rguenther@suse.de> PR tree-optimization/102893 * tree-ssa-dce.c (find_obviously_necessary_stmts): Fix the test for an exit edge. * gcc.dg/tree-ssa/ssa-dce-9.c: New testcase.
Diffstat (limited to 'gcc/tree-ssa-dce.c')
-rw-r--r--gcc/tree-ssa-dce.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index c4907af..372e069 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -436,7 +436,7 @@ find_obviously_necessary_stmts (bool aggressive)
for (auto loop : loops_list (cfun, 0))
/* For loops without an exit do not mark any condition. */
- if (loop->exits->next && !finite_loop_p (loop))
+ if (loop->exits->next->e && !finite_loop_p (loop))
{
if (dump_file)
fprintf (dump_file, "cannot prove finiteness of loop %i\n",