public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sgk at troutmask dot apl.washington.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/48979] FRACTION und EXPONENT return invalid results for infinity/NaN
Date: Thu, 12 May 2011 19:33:00 -0000	[thread overview]
Message-ID: <bug-48979-4-1gCOm2xMoR@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-48979-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48979

--- Comment #5 from Steve Kargl <sgk at troutmask dot apl.washington.edu> 2011-05-12 18:47:54 UTC ---
On Thu, May 12, 2011 at 05:59:44PM +0000, burnus at gcc dot gnu.org wrote:
> > 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).
> 
> So do I - but the question is whether it is standard conforming. NAN and INF
> are not Fortran numbers, cf. "13.4 Numeric models". Admittedly, IEEE and
> Fortran model numbers are widely mixed in the standard. However, strictly
> speaking, the IEEE functionality is only available if the relevant IEEE module
> is loaded and the feature is marked as supported.
> 

>From F2003:

Page 300:

   A program is prohibited from invoking an intrinsic procedure
   under circumstances where a value to be returned in a subroutine
   argument or function result is outside the range of values
   representable by objects of the specified type and type parameters,
   unless the intrinsic module IEEE_ARITHMETIC (section 14) is accessible
   and there is support for an infinite or a NaN result, as appropriate.

Page 364:

   The intrinsic modules IEEE_EXCEPTIONS, IEEE_ARITHMETIC, and
   IEEE_FEATURES provide support for exceptions and IEEE arithmetic.
   Whether the modules are provided is processor dependent.

1) Thomas's program does not USE IEEE_ARITHMETIC.
2) gfortran does not supply the ieee modules.

So, calling fraction() with +-Inf and NaN is, I believe,
technically non-conforming.

I agree that having consistency between constant-folding
and runtime results is desirable, I disagree on calling the
need for -fno-range-check a bug.


  parent reply	other threads:[~2011-05-12 19:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-12 15:27 [Bug fortran/48979] New: " thenlich at users dot sourceforge.net
2011-05-12 16:34 ` [Bug fortran/48979] " kargl at gcc dot gnu.org
2011-05-12 18:00 ` thenlich at users dot sourceforge.net
2011-05-12 18:04 ` burnus at gcc dot gnu.org
2011-05-12 18:37 ` sgk at troutmask dot apl.washington.edu
2011-05-12 19:33 ` sgk at troutmask dot apl.washington.edu [this message]
2011-05-12 19:45 ` sgk at troutmask dot apl.washington.edu
2011-05-12 20:32 ` sgk at troutmask dot apl.washington.edu
2011-05-12 21:07 ` burnus at gcc dot gnu.org
2011-05-12 21:11 ` sgk at troutmask dot apl.washington.edu
2011-05-12 21:12 ` sgk at troutmask dot apl.washington.edu
2011-05-13  9:28 ` thenlich at users dot sourceforge.net
2011-05-13 10:04 ` burnus at gcc dot gnu.org
2011-05-13 15:07 ` sgk at troutmask dot apl.washington.edu
2011-05-22 23:19 ` kargl at gcc dot gnu.org
2011-05-22 23:38 ` kargl at gcc dot gnu.org
2014-01-07  8:26 ` dominiq at lps dot ens.fr
2014-09-27  8:45 ` fxcoudert at gcc dot gnu.org
2014-10-11 16:58 ` fxcoudert at gcc dot gnu.org
2014-10-19 21:04 ` fxcoudert at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-48979-4-1gCOm2xMoR@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).