> On 9/17/07, Uros Bizjak <[EMAIL PROTECTED]> wrote: > > Hello! > > > > I have tripped over a problem, where #defines from libc > > (bits/mathinline.h) interfere badly with gcc's intrinsics. > > > > The problem (note the #include): > > > > --cut here-- > > #include <math.h> > > > > double test (double x) > > { > > return ceil(x); > > } > > --cut here-- > > > > when compiled with -O2 -ffast-math -msse2 -mfpmath=sse, compiles to > > asm that involves x87 insns from mathinline.h. Adding > > -D__NO_MATH_INLINES compiles to expected SSE code. > > > > As recent gcc implements all libc math intrinsics as its own builtin > > intrinsics, and due to the above interference, I'd like to propose > > that gcc defines __NO_MATH_INLINES on x86_32 target for -ffast-math, > > for both -mfpmath=sse and -mfpmath=x87. > > This "problem" has come up before and instead of gcc glibc should be fixed. > Do we make glibc aware of the user specifying -mfpmath=sse somehow?
If we really implement all of glibc logic, I think we should just teach glibc header to disable itself based on GCC version, I don't think this should be handled on GCC side. We already define __SSE_MATH__ and __SSE2_MATH__ Honza > > Richard.