Subject: Floating point quirks
To: None <port-vax@netbsd.org>
From: Jarkko Teppo <jarkko.teppo@er-grp.com>
List: port-vax
Date: 01/30/2004 08:22:52
Hi!

Todays patient is a Vax 4000/90, running 1.6ZI compiled yesterday.

There's still some weirdness going on with atan(), as the following 
example will show:

#include <stdio.h>
#include <math.h>

int main()
{
double x=0.5;
printf("%f\n",atan(x));
return(0);
}

x:~/Development/c/vax$ cc -o atan atan.c -lm
vax:~/Development/c/vax$ ./atan
Illegal instruction (core dumped)


vax:~/Development/c/vax$ cc -g -o atan atan.c -lm
vax:~/Development/c/vax$ ./atan
Illegal instruction (core dumped)


vax:~/Development/c/vax$ cc -O0 -g -o atan atan.c -lm
vax:~/Development/c/vax$ ./atan
Illegal instruction (core dumped)


vax:~/Development/c/vax$ cc -static -o atan atan.c -lm
vax:~/Development/c/vax$ ./atan
0.463648
vax:~/Development/c/vax$


How could I debug this further ? I took a brief look with objdump
and gdb before my morning coffee but unfortunately I didn't gain
any insight into the matter.

Thanks in advance,
-- 
jht