[Bug fortran/48955] [4.6/4.7 Regression] Wrong result for array assignment due to missing temporary

tkoenig at netcologne dot de gcc-bugzilla@gcc.gnu.org
Mon May 16 18:42:00 GMT 2011


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

--- Comment #7 from tkoenig at netcologne dot de <tkoenig at netcologne dot de> 2011-05-16 18:10:03 UTC ---
Hi Paul,

> Indeed - I just need to find the time to sort out the logic.
> Structurally the patch is OK.

I think the logic could be as follows: You could have two flags, one
FORWARD_ALLOWED and one BACKWARD_ALLOWED.

Initialize both flags to true.

Run through all the references which could introduce a dependency.
If there is a GFC_EQUAL dependency, do nothing.  If there is a
GFC_FORWARD dependency, set BACKWARD_ALLOW to false.  If there
is a GFC_BACKWARD dependency, set FORWARD_ALLOW to false.

When selecting the loop direction:

- If FORWARD_ALLOW is set, select a forward loop; else
     If BACKWARD_ALLOW is set, select a forward loop;
        else mark this dimension as needing a temporary.

Does this sound OK?

    Thomas



More information about the Gcc-bugs mailing list