This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]