Optimization bug (?)
Jeffrey A Law
law@cygnus.com
Sun Oct 31 23:03:00 GMT 1999
In message < Pine.LNX.4.10.9910041446170.6356-402000@saturn.astro.ufl.edu >you
>
> I compile it using:
>
> gcc -O2 -v --save-temps foo.c -lm > & gcc.out
>
> I am sending you as MIME attachments all relevant and irrelevant files
> (foo.c, foo.i.gz, foo.o, foo.s, gcc.out) ;-)
>
> When I run it, I get a segmentation fault in the second pow() call.
> It does *not* segfault when:
>
> 1. I optimize less than -O2 --or--
>
> 2. I do not have to make the (int) cast (i.e., if n is a double) --or--
>
> 3. I only have one pow() call.
>
> This is using a Linux 2.2.7-1.25 kernel (RedHat 6.0) for both
> glibc 2.1.1 and 2.1.2.
[ ... ]
I recommend you update your compiler. This sounds awful similar to something
we fixed a long time ago.
The current release is gcc-2.95.1.
jeff
More information about the Gcc-bugs
mailing list