egcs-19980906 breaks Pacific-Sierra matmul() on i686-pc-linux-gnulibc1
N8TM@aol.com
N8TM@aol.com
Tue Sep 22 22:23:00 GMT 1998
Having read that egcs-19980906 introduced optimization of sum reduction loops
where the sum is an array element, I tried this version of g77 with the
Pacific-Sierra f90 front end. It failed in matmul() at execution time, when
compiled with -O2. This works with -Os, and with -O2 on egcs-1.1. I haven't
been able to reproduce the problem with any normal g77 source code, or I'd
submit a case which doesn't depend on the p-s preprocessor and libraries.
Here is a typical g77 code expansion of matmul():
J22 = N - J
CALL ALLOCATE_F90 (8, J22, 0, D6_, 0)
D6_ = (D6_ - HEAP__1)/8
DO J2 = 1, N - J
D6(J2+D6_) = 0
DO J1 = 1, J - 1
D6(J2+D6_) = D6(J2+D6_) + B(J1+N-J,N-J+1)*B(J1,J2+J)
END DO
END DO
DO J1 = 1, N - J
B(J,J1+J) = B(N,N-J+1)*(B(J,J1+J)-D6(J1+D6_))
END DO
D6_ = D6_*8 + HEAP__1
CALL DEALLOCATE_F90 (8, J22, 0, D6_, 0)
!
so if the compiler is really smart it may see that a register scalar will
suffice in place of the allocated temporary array D6().
If no one has any other suggestions, I'll check that the same thing happens
with the latest snapshot. If so, I'll submit comparisons of the code
generated by egcs-1.1 and the snapshot.
More information about the Gcc-bugs
mailing list