From Bugzilla Helper: User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.2-2 i686) Description of problem: Reproducible bug occurs with -O2 or -O3 option. When compiling the short sample program below, gcc-2.96-85 crashes with an "Internal compiler error". Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Let gauss.c be this simple program: #include <stdlib.h> double gauss(void) { double r; r = rand()/(double)RAND_MAX; } 2. gcc -O2 -c -o gauss.o gauss.c Actual Results: gauss.c: In function `gauss': gauss.c:7: Internal compiler error in subst_stack_regs_pat, at reg-stack.c:1404 Please submit a full bug report. See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions. Expected Results: it should have compiled just fine, like it does without "-O2" Additional info: Change the result type of the function gauss from "double" to "int" or "void", and the bug goes away.
This was fixed in 2.96-86 and above.