http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48979
--- Comment #4 from Steve Kargl <sgk at troutmask dot apl.washington.edu> 2011-05-12 18:21:46 UTC --- On Thu, May 12, 2011 at 05:53:10PM +0000, thenlich at users dot sourceforge.net wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48979 > > --- Comment #2 from Thomas Henlich <thenlich at users dot sourceforge.net> > 2011-05-12 17:34:27 UTC --- > (In reply to comment #1) > > (In reply to comment #0) > > > > > > Bug 1: > > > The program does not compile without -fno-range-check. > > > > > > > Can you explain why you think that this is a bug? > > I consider it a bug because the result of the expressions FRACTION(Infinity) > and FRACTION(NaN) is defined by the Fortran standard, so the compiler should > not throw an error on simplifying them. > > Whether this really is a bug or not depends on whether one thinks that a > standard-compliant Fortran program should compile without requiring special > options (I do). > You're looking at the wrong standard. Gfortran is a Fortran 95 compiler (yes, it has many F03 and F08 extensions). The Fortran 95 standard states: 13.14.38 FRACTION(X) Result Value. The result has the value X*b**(-e), where b and e are as defined in 13.7.1 for the model representation of X. If X has the value zero, the result has the value zero. Neither NaN nor +-Inf can be represented as a model number.