alpha/72024: LONG_MIN / 1 sends a "Floating exception"

Patrick Pelissier ppelissi at
Thu Sep 23 00:30:28 PDT 2004

>Number:         72024
>Category:       alpha
>Synopsis:       LONG_MIN / 1 sends a "Floating exception"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-alpha
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 23 07:30:27 GMT 2004
>Originator:     Patrick Pelissier
>Release:        5.2.1
>Environment:> uname -a
FreeBSD 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #0: Tue Feb 24 07:42:14 GMT 2004     root at  alpha

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
( with:
gcc version 3.4.2 and gcc version 3.3.3 [FreeBSD] 20031106.

The test program was compiled without any flags:> /tmp/make/bin/gcc test3.c> ./a.out
Floating exception (core dumped)> /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
Thread model: posix
gcc version 3.4.2

The problem seems to be in the internal function "__divq" which produces the exception.

(See also )

More information about the freebsd-alpha mailing list