This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/29511] New: 0x80000000/-1 causes FPE on Intel/AMD
- From: "Eric dot Deplagne at nerim dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Oct 2006 08:02:26 -0000
- Subject: [Bug c/29511] New: 0x80000000/-1 causes FPE on Intel/AMD
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The division of 0x80000000 by -1 gives FPE on both Intel and AMD Processors...
I have checked that with the following simple program on both Fedora core 3's
GCC 3.4.4 and debian sarge's gcc-3.3.5...
I also had someone check it with gcc 4.1.2 and FreeBSD too...
int divide(int a,int b)
{
return a/b;
}
int main(void)
{
return divide(0x80000000,-1);
}
and what I get is:
./test
Floating point exception
And GDB says "Program received signal SIGFPE, Arithmetic exception."
--
Summary: 0x80000000/-1 causes FPE on Intel/AMD
Product: gcc
Version: 3.4.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Eric dot Deplagne at nerim dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29511