------- Comment #9 from rguenth at gcc dot gnu dot org 2008-04-25 10:23 ------- Not hoisting the load from x(i) is a missed PRE opportunity. Complete testcase for the second loop:
subroutine trisolve2(x,i1,i2,nxyz) integer :: nxyz real,dimension(nxyz):: au1 real,allocatable,dimension(:) :: gi integer :: i1 , i2 real,dimension(i2)::x integer :: i allocate(gi(nxyz)) do i = i1+1 , i2 x(i) = gi(i)*(x(i)-au1(i-1)*x(i-1)) enddo end subroutine trisolve2 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34163