This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SIGFPE, Arithmetic exception. "Value optimized out" when using --ffast-math


On Sat, Jul 02, 2011 at 07:01:46PM +0100, N.M. Maclaren wrote:
> On Jul 2 2011, Steve Kargl wrote:
> >On Sat, Jul 02, 2011 at 02:43:22PM +0200, Toon Moene wrote:
> >
> >>> -fno-math-errno,
> >>
> >>	No valid Fortran program can look at the (C) variable errno, so
> >>	it there is no value in pretending it can.  Loses such sequences
> >>	as (pseudo code):
> >>		call sqrt(X)
> >>                if (errno) then
> >>			exit
> >>		endif
> >
> >Apparently, you forgot about bind(c).
> 
> Don't bet on it :-(  If Toon meant 'x = sqrt(x)' with the Fortran intrinsic,
> then whether errno is set and to what is undefined.  And, if he meant an
> external subroutine written in C, C99 abolished all sanity in the support
> for errno for arithmetic errors.  It wasn't reliable even in C90.
> 

Toon wrote "No valid Fortran program can look at the (C) variable errno".
I believe the code I posted was a valid Fortran program.

QED

-- 
Steve


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]