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]

frexp function misoptimization


I notice on x86_64 Linux with gcc-4.1.2, that if I make a call to frexp()
from math.h, this function is not inlined in the assembly output
(with -O2). I've tried -ffast-math as well.

As this function could be trivially inlined (it's just a matter of getting
the correct bits from the stored number), is this a gcc misoptimization or
is glibc the culprit?

Here's a sample program:

---------------------------
#include <math.h>

int main()
{
  double x = 1.;
  int i;

  x = frexp(x, &i);
  return 0;
}
---------------------------

$ gcc -O2 -S test.c
$ cat test.s
...
       call    frexp
...

Thanks

Jeremy

-- 
Jeremy Sanders <jss@ast.cam.ac.uk>   http://www-xray.ast.cam.ac.uk/~jss/



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