This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
glibc and inline functions
- From: Scott Robert Ladd <coyote at coyotegulch dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 29 Mar 2004 13:45:04 -0500
- Subject: glibc and inline functions
Hello,
I'm confused by advice I've received herein regarding the interaction of
GCC and glibc.
In the discussion last week, some people suggested that the performance
of sin() and cos() could be improved through the application of
-D__NO_INLINE__ (or __NO_INLINES__) to a compile. This definition would,
I was informed, eliminate glibc's inline versions of those functions,
allowing GCC to generate its own (and presumably faster) code.
According to a quick grep, __NO_INLINE__ seems only to affect string
functions; it does not appear pertinent to math.h. __NO_INLINES__ does
not seem to exist, at least not in the header files I examined.
After looking over the glibc header files, I tried the following compile
commands; only the last produced any difference in executable size (a
slight reduction), while performance was identical for all.
gcc -c -O3 -ffast-math -march=pentium4
gcc -c -O3 -ffast-math -march=pentium4 -D__USE_EXTERN_INLINES
gcc -c -O3 -ffast-math -march=pentium4 -U__USE_EXTERN_INLINES
gcc -c -O3 -ffast-math -march=pentium4 -D__NO_INLINE__
gcc -c -O3 -ffast-math -march=pentium4 -D__NO_MATH_INLINES
So I'm still not certain how to solve the relatively poor performance of
GCC on programs involving math.h functions. If I'm missing something,
please let me know! :)
--
Scott Robert Ladd
Coyote Gulch Productions (http://www.coyotegulch.com)
Software Invention for High-Performance Computing