http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50698

--- Comment #7 from rguenther at suse dot de <rguenther at suse dot de> 
2011-10-17 09:26:05 UTC ---
On Sat, 15 Oct 2011, vincenzo.innocente at cern dot ch wrote:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50698
> 
> --- Comment #6 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 
> 2011-10-15 13:40:31 UTC ---
> I now moved to a more realistic case that can be reduced to this: 
> 
> void loop(float *  x, int n) {
>   for (int i=0;i!=n; ++i)
>     x[i]=x[i+n]+x[i+2*n];
> }
> 
> 
> and it creates aliases even if the memory region are clearly disjoint:
> (used gcc version 4.7.0 20111015 (experimental) (GCC) )
> keep here or open an other "enhancement request"?

The problem is that x[i] and x[i+n] may alias for n == 0.  So this
is a completely different issue - that we miss to account for the
fact that n is the loop bound for the induction variable i and that
because i is signed, n has to be >= 0.  Still we won't be able to
compute a meaningful distance vector, as it depends on n, thus
we have to version the loop anyway (the distance vector is n and 2 * n).

Thus I'd say open a separate enhancement request stating that we need
to handle non-constant distance vectors in a better way (do not hold
your breath).

Reply via email to