]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/45178 - DCE of dead control flow in infinite loop
authorRichard Biener <rguenther@suse.de>
Fri, 27 Aug 2021 07:47:49 +0000 (09:47 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 27 Aug 2021 07:51:26 +0000 (09:51 +0200)
commit41439e1f6d2da1e86538c726f0603cffd5dd098e
tree65fca8bcd2717417c16756e02f9a2270e859da91
parent44a545a6abdd330083c1d12ad70092defbba702a
tree-optimization/45178 - DCE of dead control flow in infinite loop

This fixes DCE to be able to elide dead control flow in an
infinite loop without an exit edge.  This special situation is
handled well by the code finding an edge to preserve since there's
no chance it will find the exit edge and make the loop finite.

2021-08-27  Richard Biener  <rguenther@suse.de>

PR tree-optimization/45178
* tree-ssa-dce.c (find_obviously_necessary_stmts): For
infinite loops without exit do not mark control dependent
edges of the latch necessary.

* gcc.dg/tree-ssa/ssa-dce-3.c: Adjust testcase.
gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c
gcc/tree-ssa-dce.c