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

Myles Sussman myles@luxtera.com
Fri Sep 26 20:39:00 GMT 2003


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!

Without OPTIMIZATION I see the symbol for exp in the symbol table, as is the
case when I compile without fast-math and just use optimization alone.

> gcc -ffast-math     -c sample.c
> nm sample.o

00000000 T core_c
         U exp

What happens "under the covers" when you use -ffast-math AND -O1?
Why is the symbol for exp missing in that case?


Any help would be greatly appreciated.
I am running gcc 3.2.2 under Red Hat Linux 9.



More information about the Gcc mailing list