This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: question about symbols in object file and -ffast-math with optimization turned on
- From: Joe Buck <jbuck at synopsys dot com>
- To: Myles Sussman <myles at luxtera dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 26 Sep 2003 11:51:28 -0700
- Subject: Re: question about symbols in object file and -ffast-math with optimization turned on
- References: <000201c3845e$96d3a1b0$6701010a@otter>
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.