The following program: #include <limits.h> int f(long a, long b); int main() { return f(LONG_MIN, 1); } int f(long a, long b) { return a / b; } produces a "Floating exception (core dumped)" on alpha-unknown-freebsd5.2.1 (spe149.testdrive.hp.com) with: gcc version 3.4.2 and gcc version 3.3.3 [FreeBSD] 20031106. The test program was compiled without any flags: spe149.testdrive.hp.com> /tmp/make/bin/gcc test3.c spe149.testdrive.hp.com> ./a.out Floating exception (core dumped) spe149.testdrive.hp.com> /tmp/make/bin/gcc -v Reading specs from /tmp/make/lib/gcc/alpha-unknown-freebsd5.2.1/3.4.2/specs Configured with: ./configure --prefix=/tmp/gcc : (reconfigured) ./configure --prefix=/tmp/gcc : (reconfigured) ./configure --prefix=/tmp/make --enable-languages=c Thread model: posix gcc version 3.4.2 The problem seems to be in the internal function "__divq" which produces the exception.
__divq is provided by FreeBSD's libc. Please report a bug there.