The following code produces an ICE when compiled with gfortran using the -O and -fno-automatic flags together. This bug exists in gfortran 4.1.0-0.12, but not in 4.0.2-8. $ cat hwhew2.f SUBROUTINE HWHEW2(NPART) IMPLICIT NONE COMPLEX PT5,ZT,ZI DOUBLE PRECISION WRN(7) INTEGER J,I,NPART,IP1 DO 11 I=1,NPART-1 IP1=I+1 DO 11 J=IP1,NPART IF(WRN(I).LT.0) ZT=ZT*ZI IF(WRN(J).LT.0) ZT=ZT*ZI PT5=CMPLX(.5,0.) 11 CONTINUE RETURN END $ gfortran -c -O -fno-automatic hwhew2.f hwhew2.f: In function 'hwhew2': hwhew2.f:1: internal compiler error: in referenced_var_lookup, at tree-dfa.c:591 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
Seems to be fixed in 4.1.0-0.14. I hope it will not reappear in a new version.