This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch, fortran] PR 45159, dependency checking
- From: Thomas Koenig <tkoenig at netcologne dot de>
- To: fortran at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 02 Aug 2010 21:17:45 +0200
- Subject: [patch, fortran] PR 45159, dependency checking
Hello world,
this rather simple patch fixes one test case from PR 45159 (many more to
go). This one is rather important because this is a real-world hot
loop. Regression-tested. OK for trunk?
(BTW, did the loop reversal stuff get committed to 4.5 as well? If this
is the case, I would also want to fix this there).
Thomas
2010-08-02 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/45159
* depencency.c (gfc_dep_resolver): Fix logic for when a loop
can be reversed.
2010-08-02 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/45159
* gfortran.dg/dependency_29.f90: New test.
! { dg-do compile }
! { dg-options "-Warray-temporaries" }
subroutine t1(n1,n2, gfft, ufft)
implicit none
integer :: n1, n2, i
real :: gfft(n1,n2), ufft(n2)
DO i=1, n1
gfft(i,:)=gfft(i,:)*ufft(i)
END DO
end subroutine t1
Index: dependency.c
===================================================================
--- dependency.c (Revision 162824)
+++ dependency.c (Arbeitskopie)
@@ -1716,8 +1716,8 @@ gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gf
/* If no intention of reversing or reversing is explicitly
inhibited, convert backward dependence to overlap. */
- if ((reverse == NULL && this_dep == GFC_DEP_BACKWARD)
- || (reverse && reverse[n] == GFC_CANNOT_REVERSE))
+ if (this_dep == GFC_DEP_BACKWARD
+ && (reverse == NULL || reverse[n] == GFC_CANNOT_REVERSE))
this_dep = GFC_DEP_OVERLAP;
}