This is the mail archive of the gcc-help@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]

GCC's -ffast-math behavior


Hi, all

There is something with -ffast-math I don't understand.

I want to know why gcc don't use other math lib when using -ffast-math.

Take the test.c for example,

       gcc -O3 -c test.c -o test1.o
       nm test1.o  shows:
------------------------
00000000 b .bss
00000000 d .data
00000000 i .drectve
00000000 r .eh_frame
00000000 r .rdata
00000000 t .text
00000000 t .text.startup
         U ___main
         U _exp
00000000 D _in
00000000 T _main
00000080 C _out
         U _printf
------------------------

       gcc -O3 -ffast-math -c test.c -o test2.o
       nm test.2.o shows:
------------------------
00000000 b .bss
00000000 d .data
00000000 i .drectve
00000000 r .eh_frame
00000000 r .rdata
00000000 t .text
00000000 t .text.startup
         U ___main
00000000 D _in
00000000 T _main
00000080 C _out
         U _printf
------------------------

When using -ffast-math, gcc don't generate the math function symbol: U _exp

That causes the problem: if I have other optimization math lib (such as Intel Math Lib), gcc can't link the obj with the lib, but when no using -ffast-math, the lib can be linked with.

So I want to know: are there some methods when using -ffast-math, I also can link it with the optimization math lib?

Many thanks.

--
Best Regards,
xunxun

Attachment: test.c
Description: Text document


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