This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Define __NO_MATH_INLINES for x86 -ffast-math?
- From: "Uros Bizjak" <ubizjak at gmail dot com>
- To: "GCC Development" <gcc at gcc dot gnu dot org>
- Date: Mon, 17 Sep 2007 10:57:19 +0200
- Subject: Define __NO_MATH_INLINES for x86 -ffast-math?
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.
Uros.