Subject: Re: Division by zero doesn't raise SIGFPE
To: Min Sik Kim <minskim@bawi.org>
From: Greywolf <greywolf@starwolf.com>
List: current-users
Date: 12/15/2003 15:34:08
Thus spake Min Sik Kim ("MSK> ") sometime Today...

MSK> Hi,
MSK>
MSK> I expect the following code (used by many GNU configure scripts) raise
MSK> SIGFPE, but it only hangs consuming 100% CPU time.  This wasn't
MSK> happening on 1.6.1, but seen after I moved to -current.
MSK>
MSK> Any ideas?
MSK>
MSK> Min
MSK>
MSK> ================================
MSK> int main() {
MSK>   int a;
MSK>   int b;
MSK>   int c;
MSK>
MSK>   a = 1;
MSK>   b = 0;
MSK>   c = a / b;
MSK>
MSK>   return 0;
MSK> }
MSK> ================================

Which version of gcc are you using?

The above code for me actually returns (exits) 0 unless I compile with
-O0, gcc 3.3.2.

I think this needs to be filed as a bug against gcc.

				--*greywolf;
--
"Never mind the bollocks, here's NetBSD!"