lkml.org 
[lkml]   [1998]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjecthave a look at this proggie, please.
/* 
* 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/

\
 
 \ /
  Last update: 2005-03-22 13:45    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site