------- Comment #11 from dominiq at lps dot ens dot fr 2010-05-22 10:50 ------- > For x(la:ua:sa) = x(lb,ub,sb), there can be no collision > > if abs(la-lb) mod gcd(sa, sb) == 0 > > where gcd is the greatest common divisor.
You probably mean "if abs(la-lb) mod gcd(sa, sb) != 0" (assuming x(lb:ub:sb);-). Note that if I am not mistaken, this result extends to multi-dimension arrays: a(1,:) never overlap a(2,:) if the extent of the first dimension is larger than 1 (or a(1:x:2,:) and a(2:y:2,:) if a(2*n,m)). > Also, it would be nice to have complete simplification so that cases like > > a(2*n**2+3*n+1:x:2) = a(2*n**2+3*n:x:2) > > can be caught. I think you assume that n is unknown at compile time, isn't it? In this case you need to find in gcc a simplifier for la-lb. Did you have a look to graphite or did you contact the guys? They may have some answer to this kind of problem. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36928