Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Apr 1998 15:28:41 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        ajhar@noao.edu, freebsd-bugs@hub.freebsd.org
Subject:   Re: i386/3895: False FPE (floating point exception) signaled
Message-ID:  <199804150528.PAA32452@godzilla.zeta.org.au>

index | next in thread | raw e-mail

> The second example was an assignment of an integer function to an
> integer and having it give a false SIGFPE.  It turns out that this
> function when defined was an INTEGER but was implicitly declared a
> REAL when it was called in the code (because of Fortran's implicit
> rules).  Again, the compilers were perfectly happy to swallow all
> this, and the code was happy to run on the (Solaris) UltraSparc with
> the same code (without any problem) and to run happily for a while on
> the (FreeBSD) Pentium Pro machine.  But, eventually, a false SIGFPE
> resulted.
> 
> All this led me to conclude that there is probably a bug somewhere in
> the i386 gcc code because the results were the same whether using f2c
> (which converts the Fortran code into C, which is then compiled
> directly with gcc as C code) or g77 (which is the Fortran front-end of
> gcc).

I conclude that it is a user or g77 bug, most likely the former.
Calling a C function that returns double but is implicitly or mis-
declared as returning another type gives undefined behaviour.
The error is actually detected under FreeBSD.  I know very little
about Fortran, but guess it requires less type checking/rewriting
than C.

Bruce

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message


help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804150528.PAA32452>