------- Comment #12 from tkoenig at gcc dot gnu dot org  2010-05-22 21:20 
-------
(In reply to comment #11)

> You probably mean "if abs(la-lb) mod gcd(sa, sb) != 0" (assuming
> x(lb:ub:sb);-).

Yes, I had this reversed when I wrote this.

Note that if I am not mistaken, this result extends to

> > 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.

We already have very aggressive simplification operating on trees,
which can do this.  The code in depedency.c operates on gfc_expr
only, and includes a limited simplification for catching stuff
like a(x) vs a(x+1).

Paul, what do you think of the idea of using the tree simplifier
for something like a(2*n**2+3*n:m:2) = a(2*n**2+3n+1:m:2)?
It should be able to calculate the difference of the lower bounds and
find out it is a constant, but maybe some prerequisite isn't there
when dependency checking is done.


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pault at gcc dot gnu dot org


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

Reply via email to