I compiled this test case in a i686-pc-linux-gnu gcc configured with --with-arch=pentium4:
long long foo(long long v) { return v / -0x080000000LL; } void main() { if (foo(0x080000000LL) != -1) abort(); exit (0); } The value of 0x80000000LL / -0x80000000LL is -1. However, gcc computes it as 0, and the test fails. It fails at -O0 but succeeds if the division is inlined. -- Summary: Error in 64-bit division for 32-bit target Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ian at airs dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42099