[Bug tree-optimization/81834] loop with increment conditional on IV is not optimized out
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Aug 16 10:05:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81834
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-08-16
CC| |rguenth at gcc dot gnu.org
Summary|Simple loop with single |loop with increment
|variable is not optimized |conditional on IV is not
|out |optimized out
Ever confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
There's a chicken-and-egg issue in optimization -- proving that i < 1000 is
always
true for the increment requires the number of iterations to be known and that
requires this condition to be simplified.
optimistic VRP should be able to figure this out together with SCEV but SCEV
isn't fed with the intermediate VRP info nor does VRP query SCEV during
iteration at the right point.
Quite an arcane case though...
clang doesn't get it either.
More information about the Gcc-bugs
mailing list