This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Define __NO_MATH_INLINES for x86 -ffast-math?
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Uros Bizjak" <ubizjak at gmail dot com>
- Cc: "GCC Development" <gcc at gcc dot gnu dot org>
- Date: Mon, 17 Sep 2007 10:59:04 +0200
- Subject: Re: Define __NO_MATH_INLINES for x86 -ffast-math?
- References: <5787cf470709170157i77b50e93l60c6caad6113d946@mail.gmail.com>
On 9/17/07, Uros Bizjak <ubizjak@gmail.com> 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?
Richard.