g++-2.91.34 19980530 : code generation bug onsparc-sun-solaris2.5.1 with -O2

Gerald Pfeifer pfeifer@dbai.tuwien.ac.at
Fri Sep 4 06:48:00 GMT 1998


On June 3rd, 1998, Laurent Bonnaud wrote:
> the following code compiles, but when it is run, it crashes with a "Bus
> Error".  The program itself has no bugs : it uses no pointers ans has
> been checked with purify.  The same program runs without crashing, if
> it is compiled with -O0, -O1 or -O3 (because the constructor call is
> then inlined).

Good news! While I have been able to reproduce your bug with
egcs-nearly-1.1 under exactly those conditions you have described,
the current version in the mainline seems fine.

> % g++ -O2 bug.cc
> % ./a.out 
> Bus error

markab[171]:~% /sw/swtest/egcs/NEW/bin/g++ -v
gcc version egcs-2.92.02 19980904 (gcc2 ss-980609 experimental)
markab[172]:~% /sw/swtest/egcs/NEW/bin/g++ -O2 bug.cc
markab[173]:~% ./a.out
markab[174]:~% 


This might be due to a recent rewrite of the sparc backend by David S.
Miller <davem@dm.cobaltmicro.com>, I guess.

Gerald
-- 
Gerald Pfeifer (Jerry)      Vienna University of Technology
pfeifer@dbai.tuwien.ac.at   http://www.dbai.tuwien.ac.at/~pfeifer/




More information about the Gcc-bugs mailing list