re PR libstdc++/85116 (std::min_element does not optimize well with inlined predicate)
authorRichard Biener <rguenther@suse.de>
Thu, 26 Apr 2018 12:18:58 +0000 (12:18 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 26 Apr 2018 12:18:58 +0000 (12:18 +0000)
commit1c53fa8ca9912f6acf8c3c8cec31d647bd8ba691
treef4f5507e0f552943eaa12d63ed635e309b424b20
parentae05281f4ac17db1d602bdd59d3fdd5acc3752ff
re PR libstdc++/85116 (std::min_element does not optimize well with inlined predicate)

2018-04-26  Richard Biener  <rguenther@suse.de>

PR tree-optimization/85116
* tree-ssa-loop-ch.c (do_while_loop_p): A do-while loop should
have a loop exit from the single latch predecessor.  Remove
case of header with just condition.
(ch_base::copy_headers): Exclude infinite loops from any
processing.
(pass_ch::execute): Record exits.

* gcc.dg/tree-ssa/copy-headers-2.c: New testcase.
* gcc.dg/tree-ssa/copy-headers-3.c: Likewise.
* gcc.dg/tree-ssa/copy-headers-4.c: Likewise.
* gcc.dg/tree-ssa/loadpre6.c: Adjust.

From-SVN: r259672
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/copy-headers-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/copy-headers-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/copy-headers-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c
gcc/tree-ssa-loop-ch.c