https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62630
--- Comment #15 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Mircea Namolaru from comment #14) > It seems to me that scalar evolution succeeds to determine > the number of iterations for the case of signed longs. Looking > in vectorization dump, first a symbolic expression for the number of > iterations of a loop is found, and then vect_analyze_refs is entered. > The problem is that the code expect an offset of a load to be an induction > variable, > but in our case an offset is only a cast of an induction variable, like > below: > > _56 = (intD.6) graphite_IV.5_53; > _55 = aD.1830[_56]; > > The offset is found not to be an affine expression, and vectorization don't > succeed. But as the offset is a cast of an induction variable, it has the > same > behaviour as an induction variable even if formally is not one. This is not true - the cast of the induction variable is not an affine IV as the cast introduces wrapping if the IV exceeds the range of the casted-to type. number-of-iteration analysis can come to the rescue here but it has a very hard time, especially on the 2nd loop. It would be good to improve it anyway but we can hardly blame it solely for the problems ;) > It seems to > me > that somehow extending the code to support casts of induction variables > will solve our this problem.
