2017-12-14 Richard Biener <rguenther@suse.de>
commit1d183080ed126bedbe0f3a8b15a09186b9ebbc27
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Dec 2017 14:32:24 +0000 (14 14:32 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Dec 2017 14:32:24 +0000 (14 14:32 +0000)
tree4ed9aa324a460c80fca144994aeda6284b57d5b2
parent57904972d5515909edfa4f64cdd51b7ee324c876
2017-12-14  Richard Biener  <rguenther@suse.de>

PR tree-optimization/83326
* tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Add
may_be_zero parameter and handle it by not marking the first
peeled copy as not exiting the loop.
(try_peel_loop): Likewise.
(canonicalize_loop_induction_variables): Use number_of_iterations_exit
to handle the case of constant or zero iterations and perform
loop header copying on-the-fly.

* gcc.dg/tree-ssa/pr81388-2.c: Adjust.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255635 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr81388-2.c
gcc/tree-ssa-loop-ivcanon.c