Description of problem: gcc crashes with the following message: gcc -g -O2 -c eval.c -o eval.o eval.c: In function `conv_literal': eval.c:52: Internal compiler error in subst_stack_regs_pat, at reg- stack.c:1414 Please submit a full bug report. See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions. Version-Release number of selected component (if applicable): gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-112_MSDW_2) How reproducible: Always. I am reproducing the code fragment that led to this. There is a parse error here, but gcc crashes instead. typedef struct _Lit { double *col; /* pointer to column */ char col_name; /* name of the column */ int offset; /* row denoting offset of column */ } Lit; /* access macros */ #define LIT_COL(e) ((e)->col) #define LIT_NAME(e) ((e)->col_name) #define LIT_OFF(e) ((e)->offset) static inline int compute_row (int curr_row, int offset) { return curr_row + offset - START_ROW; } double conv_literal (int row, Lit *literal) { double val; #if 0 printf ("row %d\n", row); #endif val = (LIT_COL(literal))[compute_row(row, LIT_OFF(literal))]; #if 1 printf ("%c%d (%d) = %f\n", LIT_NAME (literal), LIT_OFF(literal), compute_row (row, LIT_OFF(literal)) + 2, val); } #endif return (val); } Steps to Reproduce: 1. gcc -g -O2 -c eval.c -o eval.o produces the error, where eval.c contains the code fragment. Actual results: Expected results: Additional info:
Fedora Core 3 doesn't include GCC 2.96-RH. With gcc-2.96-128.7.2 (current AS2.1 compiler) I get: gcc -g -O2 -S eval.c eval.c: In function `compute_row': eval.c:13: `START_ROW' undeclared (first use in this function) eval.c:13: (Each undeclared identifier is reported only once eval.c:13: for each function it appears in.) eval.c: In function `conv_literal': eval.c:29: confused by earlier errors, bailing out If I add int START_ROW; to the beginning to get around this bug, I get: gcc -g -O2 -S eval.c eval.c:32: parse error before `return'
Interesting. The bug seems to have disappeared now. I am unsure what happened then, but I was able to reproduce the bug multiple times, and yet it does not happen anymore. Sorry about the confusion. -Anindya
Bug evaporated.