This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/48052] loop not vectorized if index is "unsigned int"
- 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, 06 May 2015 06:56:57 +0000
- Subject: [Bug tree-optimization/48052] loop not vectorized if index is "unsigned int"
- Auto-submitted: auto-generated
- References: <bug-48052-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48052
--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
That's an interesting idea - your argument is that if niter analysis was able
to compute an expression for the number of iterations and the cast we are
looking at
is a widening of a BIV then it is ok to assume the BIV does not wrap.
Unfortunately this breaks down (eventually not in practice due to your
exclusion of constant initial BIV value) for cases like
for (unsigned i = 3; i != 2; i+=7)
;
where niter analysis can still compute the number of iterations (I've made
the numbers up, so maybe that loop will never terminate...).
Still the idea is interesting as we might be able to record whether BIVs
overflow or not.