bug repport
Raphael Gignac
rgignac@rfv.insa-lyon.fr
Fri Jun 18 08:36:00 GMT 1999
Hi, first of all, please excuse my english, I will try to do my best.
version:
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/specs
gcc version 2.7.2.3
$ g++ -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.90.29/specs
gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
The source code (.cpp) and the assembly code (.s) are in attachement.
The problem is (it's not really a bug but it could conduct to) that
(probably because of the optimisation) the compiler put the string ("my
string") in memory only one time. But the string is use 2 times in the cpp
files. It conduct to succes on the if test. This could really cause bugs
in bigger programs.
The .s was compiled with:
$ g++ -S -pedantic -Wall -O0 problem.cpp
Note that I use no optimisation.
In .s file, we can see that the string .LC0 ("my string") is allocated
only one time!
I don't know if there is a new version of g++ with the bug fix, if the
answer is YES I will go get it.
Thanks for keeping me inform.
Raphael Gignac
Student in electrical engeneering, University Laval, Quebec, Canada
mailto:rgignac@ieee.org
More information about the Gcc-bugs
mailing list