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

Patrick Pelissier ppelissi at caramail.com
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
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 23 07:30:27 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Patrick Pelissier
>Release:        5.2.1
>Organization:
>Environment:
spe149.testdrive.hp.com> uname -a
FreeBSD spe149.testdrive.hp.com 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #0: Tue Feb 24 07:42:14 GMT 2004     root at mithlond.btc.adaptec.com:/usr/obj/usr/src/sys/GENERIC  alpha

>Description:
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.

(See also
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17613 )
 
>How-To-Repeat:
      
>Fix:
      
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-alpha mailing list