This is the mail archive of the gcc-bugs@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]

Re: 1.1b: asinh breaks at -O1



  In message <19981001222047.A19471@zensunni>you write:
  > [This problem has been reported as a bug through the Debian bugtracking
  > system (http://www.debian.org/Bugs/); please Cc: 27146@bugs.debian.org on
  > on-topic replies]
  > 
  > OS: Linux 2.0.35
  > Architecture: i686
  > egcs: 1.1b
  > libc: GNU libc 2.0.7 (aka libc6)
  > 
  > Code test.c:
  > #include <stdlib.h>
  > #include <math.h>
  > 
  > int main()
  > {
  >   double z = 3;
  > 
  >   printf("glib result asinh(%f)=%f\n", -z, asinh(-z));
  >   printf("glib result asinh(%f)=%f\n", z, asinh(z));
  >   exit(0);
  > }
  > 
  > Behaviour: 
  > 
  > egcc -O0 test.c -lm ; ./a.out # As expected
  > glib result asinh(-3.000000)=-1.818446
  > glib result asinh(3.000000)=1.818446
  > 
  > egcc -O1 test.c -lm ; ./a.out # bug: asinh misbehaves with negative argumen
  > t
  > glib result asinh(-3.000000)=NaN
  > glib result asinh(3.000000)=1.818446
Can someone who either a.  Knows the x86 or b. has a debugger which will
print the FP variables under linux take a look at this?

I'd do it, but I don't know the x86 well enough to just look at the assembly
code and figure out what's going on.  And for reasons I don't want to know, gdb
won't access the floating point regs on a linux box, so I can't run it under
the debugger to find out why we're losing.

jeff


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