This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Fortran] Another round of WHERE statement optimizations


Roger (and Brooks),

The patch is OK. All the testscases need their DejaGnu { dg-do run }'s of course.

Brooks' tests are a useful addition; especially since the last one fails (and is wrong, I think).

The failure occurs in the 1st half of the test and is present in 4.1:

! Check to ensure result is calculated from unmodified
! version of the right-hand-side in WHERE statements.
program where_19_reduced
integer :: a(4)
integer :: b(3)
integer :: c(3)
equivalence (a(1), b(1)), (a(2), c(1))

a = (/1, 2, 3, 4/)
where (b .gt. 1) ! applies to b(2) and b(3)
c = b ! so a(3) = c(2) = b(2) = 2 & a(4) = c(3) = b(3) = 3
endwhere ! => a = (/1,2,2,3/) which is what ifort gives.
if (any (a .ne. (/1, 1, 2, 3/))) & ! condition is wrong
print *, "#1", a ! gfortran gives a = (/1,2,2,2/) - no temporary for a
! equivalence of c and b, thru' a should be detected.
end program

This is a failure of dependency analysis in gfortran for equivalence group objects (PR, Andrew?) that is already present and has been reported.

Since this is another problem, I think that the patch is OK for trunk, with an XFAIL on a corrected where_19.f90

Paul T



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]