have a look at this proggie, please.

Tigran Aivazian (tigran@aivazian.demon.co.uk)
Wed, 18 Nov 1998 10:13:51 +0000 (GMT)


/*
* Hi guys,
*
* Compile this without optimization: gcc -g -Wall tst.c -o tst
* and see what happens (SIGFPE). Kernel is 2.1.127 but I think it happens
* on 128 as well (and all others starting from 0.99, or even non-Linux
* systems). What I am asking is - even if it is a CPU bug (all in 386-Xeon range)
* Linux still should be able to work around it (if Solaris can!), should it not?
*
*/

#include <values.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
int a = -MAXINT-1, b = -1, c = a*b;

fprintf(stderr, "%d * %d = %d\n", a, b, c );
if (b) {
c = a / b;
fprintf(stderr, "%d/%d = %d\n", a, b, c );
}
return 0;
}

/*
* Regards,
* Tigran
*/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/