http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54522
Bug #: 54522 Summary: Using "g77 -O -fno-automatic", reassignment of a variable in an if statement in a function triggers a compiler bug. Classification: Unclassified Product: gcc Version: 3.4.6 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassig...@gcc.gnu.org ReportedBy: a...@psu.edu C g77 bug found 9/7/2012. C When command "g77 -c -O -fno-automatic reasssignment_bug.for" is C used on the included code, the following is produced: C C reassignment_bug.for: In function `dum': C In file included from reassignment_bug.for:0: C reassignment_bug.for:7: internal compiler error: in gen_reg_rtx, at C emit-rtl.c:819 C Please submit a full bug report, C with preprocessed source if appropriate. C See <URL:http://bugzilla.redhat.com/bugzilla> for instructions. C C The code is non-sensical but valid and should not crash the compiler. C The logic was found in a larger more complex piece of code where the C cause was hard to find. C C Compiler version from "g77 -v": C Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs C Configured with: ../configure --prefix=/usr --mandir=/usr/share/man C --infodir=/usr/share/info --enable-shared --enable-threads=posix C --disable-checking --with-system-zlib --enable-__cxa_atexit C --disable-libunwind-exceptions --enable-languages=c,c++,f77 C --disable-libgcj --host=x86_64-redhat-linux C Thread model: posix C gcc version 3.4.6 20060404 (Red Hat 3.4.6-19.el6) C FUNCTION DUM(A) B=A IF (B.EQ.1) B=A DUM=B RETURN END