Re: Posible bug in gcc

Richard B. Johnson (root@chaos.analogic.com)
Mon, 26 Feb 2001 13:02:45 -0500 (EST)


On Mon, 26 Feb 2001, Alan Cox wrote:

> > > Well gcc-bugs would be the better place to send it but this is a known problem
> > > fixed in CVS gcc 2.95.3, CVS gcc 3.0 branch and gcc 2.96 (unofficial, Red Hat)
> >
> > I'm not sure if it is known, at least not known to me, but definitely not
> > fixed in any of gcc 2.95.2, CVS gcc 3.0 branch, CVS gcc 3.1 head, gcc 2.96-RH.
>
> Sorry my error for assuming it was the exsting known strength reduce bug
>

Script started on Mon Feb 26 12:54:20 2001
# gcc -o xxx bug.c
# ./xxx
Correct output: 5 2
GCC output: 5 2
# gcc --version
egcs-2.91.66
# gcc -O2 -o xxx bug.c
# ./xxx
Correct output: 5 2
GCC output: 10 5
# exit
exit

Script done on Mon Feb 26 12:55:21 2001

Definitely has something to do with broken optimization. No optimization,
no bug, turn on '-O2' and you have the bug.

Cheers,
Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/