question about symbols in object file and -ffast-math with optimization turned on

Joe Buck jbuck@synopsys.com
Fri Sep 26 21:36:00 GMT 2003


On Fri, Sep 26, 2003 at 11:47:08AM -0700, Myles Sussman wrote:
> I have a simple piece of code shown below
> ______________________________
> #include <math.h>
> 
> void core_c(float* numbers, int imax, float* results)
> {
>   int i;
>   for (i=0;i<imax;++i)
>     {
>       results[i] = exp(numbers[i]);
>     }
> }
> _____________________________
> 
> I compiled this with optimization and fast-math:
> 
> > gcc -ffast-math -O1 -c sample.c
> > nm sample.o
> 
> 00000000 T core_c
> 
> Notice I don't see the function "exp" in the symbol table!

That's because, with -ffast-math on the x86 architecture, inline
code is generated to compute exp.  To see the code, give the -S
option.



More information about the Gcc mailing list