This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/81834] loop with increment conditional on IV is not optimized out
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 16 Aug 2017 08:03:30 +0000
- Subject: [Bug tree-optimization/81834] loop with increment conditional on IV is not optimized out
- Auto-submitted: auto-generated
- References: <bug-81834-4@http.gcc.gnu.org/bugzilla/>
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.