Description of problem: //////////main.c extern double rightfunc(double); extern double wrongfunc(double); int main(void) { if (rightfunc(0.75) != 0.75) return 1; const double x = 0.25; if (wrongfunc(x) != 0.25) return 2; return 0; } //////////funcs.c extern double rightfunc(double); extern double wrongfunc(double); double rightfunc(double t) { return t; } double wrongfunc(const double t) { return t; } //////////GNUmakefile: all: right wrong right: main.c funcs.c; gcc -O3 -o $@ main.c funcs.c wrong: main.c funcs.c; gcc -O3 -ffloat-store -o $@ main.c funcs.c With the three supplied files, use gmake to build. The generated 'right' file works properly, but the generated 'wrong' file generates incorrect code for the 'wrongfunc' function: wrongfunc: pushl %ebp movl %esp, %ebp subl $8, %esp fldl -8(%ebp) leave ret Basically, the code uses memory that has not be set to the value passed as the 'const double' argument. Note that rightfunc() has a double argument, while wrongfunc() has a const double argument. Otherwise they are the same. The 'wrong' file is built with -ffloat-store while the 'right' file is built without. Version-Release number of selected component (if applicable): gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-112.7.2) How reproducible: Always Steps to Reproduce: 1. Create specified main.c, funcs.c, and GNUmakefile 2. gmake 3. ./wrong Actual Results: ./wrong exits with 2. Expected Results: ./wrong should exit with 0 (like ./right). Additional info: This bug occurs when using -ffloat-store with gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-112.7.2), with or without optimization. It does not occur with gcc 2.91 or gcc 3.2.2.
Indeed fixed in gcc 3.2.
So, 584 days after the bug report was submitted, the only response is to repeat a point made in the initial report and close the bug report?
RHL 7.2 is not supported any longer, this will not be fixed in GCC 2.96-RH.
But it was supported at the time that the bug report was submitted.