In <[EMAIL PROTECTED]> Dalibor Topic wrote:
for i in test/regression/*.fail ; do \ name=`dirname $i`/`basename $i .fail` ; \ diff -u $name.out $name.fail ; \ done
--- test/regression/DoubleCvt.out 2004-04-28 16:55:27.000000000 +0200
+++ test/regression/DoubleCvt.fail 2004-04-28 16:55:37.000000000 +0200
@@ -7,7 +7,7 @@
MIN_VALUE as int: 0 0
MIN_VALUE as long: 0 0
MAX_VALUE: 7fefffffffffffff
-MAX_VALUE as float: 7f800000
+MAX_VALUE as float: 7f7fffff
MAX_VALUE as int: 2147483647 7fffffff
MAX_VALUE as long: 9223372036854775807 7fffffffffffffff
POSITIVE_INFINITY: 7ff0000000000000
I've looked more closely into this one. Something goes bad when d2f bytecode instruction is exectued in this case. the implementation in intrp/icode.h looks innocent enough, but I'm not sure what should happen precisely when max double is assigned to a float in C. I've written a test case, and attached it, so it'd be nice if you could run it on your netbsd-ppc machine and report the results.
cheers, dalibor topic
#include <stdio.h>
union dtype {
double d;
long long l;
};
typedef union dtype dtype;
union ftype {
float f;
int i;
};
typedef union ftype ftype;
int main(void) {
dtype d;
ftype f;
ftype g;
d.d = 1.7976931348623157E308;
f.f = d.d;
g.f = (float) d.d;
printf("d = %g\t f = %f\t g=%f\n", d.d, f.f, g.f);
printf("d = %Lx\t f = %x\t g=%x\n", d.l, f.i, g.i);
f.f = 3.4028234663852885981e+38f;
printf("f.f = %g\t f.i = %x\n", f.f, f.i);
}
