divide overflow and optimizer bug

Jason Schonberg schon@mips.com
Thu May 20 16:43:00 GMT 1999


While the results of the code provided below may indeed be undefined, the 
compiler should not crash when compiling this.

Thanks for your assistance.

Jason Schonberg
schon@mips.com

fptest.c :
_____
#include <limits.h>

int main()
{
 long int A, B, C;
 A = INT_MIN;
 B = -1;
 C = A/B;
}
____
[schon@pc-linux fptest]$ uname -a 
Linux pc-linux 2.2.5-15 #1 Mon Apr 19 23:00:46 EDT 1999 i686 unknown
[schon@pc-linux fptest]$ gcc -v
Reading specs from /usr/local/lib/gcc-lib/i686-linux-gnu/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
[schon@pc-linux fptest]$ gcc -o run fptest.c
[schon@pc-linux fptest]$ gcc -O2 -o run fptest.c
../../egcs-1.1.2/gcc/toplev.c:2261: Internal compiler error in function 
float_signal



More information about the Gcc-bugs mailing list