See attached test-case, test.f: > gfortran -c test.f -O1 Compiles OK
> gfortran -c test.f -O2 test.f: In function "test": test.f:13: internal compiler error: in emit_swap_insn, at reg-stack.c:827 > gfortran -v Using built-in specs. Target: i586-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch=i586 --build=i586-redhat-linux Thread model: posix gcc version 4.4.0 20090506 (Red Hat 4.4.0-4) (GCC) > uname -a Linux pmblakely 2.6.29.5-191.fc11.i686.PAE #1 SMP Tue Jun 16 23:19:53 EDT 2009 i686 i686 i386 GNU/Linux This looks similar to the test-case for bug 39607 (fixed), in that the ICE occurs when returned/class variables are only updated if a certain condition holds, and otherwise a separate function is called, resulting in those variables not being updated. Note that the test-case for bug 39607 compiles correctly (i.e. no ICE) for this version of gcc, so it's not a case of that patch not having gone through for this compiler version. -- Summary: ICE in emit_swap_insn at reg-stack.c:827 Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pmblakely at googlemail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40587