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/57871] gfortran -freal-4-real-16 gives wrong result for selected_real_kind(1)
Date: Thu, 11 Jul 2013 22:51:00 -0000	[thread overview]
Message-ID: <bug-57871-4-5MJydzdQNa@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-57871-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Thu, Jul 11, 2013 at 10:30:04PM +0000, harper at msor dot vuw.ac.nz wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57871
> 
> --- Comment #5 from harper at msor dot vuw.ac.nz ---
> I have now found two more oddities of type promotion but I don't claim 
> that these are gfortran bugs, only that the mmanual might need amending.
> 
> Oddity 1. Although -freal-4-real-8 does what the manual implies with
> the program below (making the real kinds 8,10,16 on an x86_64 system),
> -fdefault-real-8 keeps the available kinds at 4,8,10,16 but merely
> changes the defaults. I suggest that the following sentence 
> be added to the manual sewction on -fdefault-real-8 at the end:
> 
> If "REAL(KIND=4)" is a real type available with no -f options, then it
> remains available with -fdefault-real-8 though not with -freal-4-real-8.
> 
> Oddity 2. If one uses -fdefault-double-8 in a system where default real
> was 4 bytes wide then one must also use -fdefault-real-8. The manual
> entries for -fdefault-double-8 and -fdefault-real-8 are both silent 
> on what happens if -fdefault-double-8 is given but -fdefault-real-8 is 
> not. I won't suggest an amendment here because I don't know what happens 
> in a system whose default real with no -f options was 8 bytes wide.

I am not at all surprised by your findings.  I would personally
like to deprecate the -fdefault-* options.  These options do
not necessarily do what a user may expect.  The options require
care with EQUIVALENCE, COMMON, and may even require one to
rebuild the runtime library (if one is doing double precision
IO).  Most users don't understand the limitations, and simply
use these options as a quick-n-dirty way to port single
precision code to double precision.  Unfortunately, the -fdefault-*
options are too ingrained into peoples brains.

The -freal-* options were a later attempt to try to fix
the deficiencies with the -fdefault-* options.  These 
family of option should not be mixed.  I suppose this
should be documented.


  parent reply	other threads:[~2013-07-11 22:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09 23:38 [Bug fortran/57871] New: " john.harper at vuw dot ac.nz
2013-07-10 13:07 ` [Bug fortran/57871] " dominiq at lps dot ens.fr
2013-07-10 17:42 ` kargl at gcc dot gnu.org
2013-07-10 20:02 ` sgk at troutmask dot apl.washington.edu
2013-07-10 21:31 ` harper at msor dot vuw.ac.nz
2013-07-11 22:30 ` harper at msor dot vuw.ac.nz
2013-07-11 22:51 ` sgk at troutmask dot apl.washington.edu [this message]
2013-11-25  0:59 ` kargl at gcc dot gnu.org
2021-03-04 11:59 ` dominiq at lps dot ens.fr
2021-03-05  9:43 ` cvs-commit at gcc dot gnu.org
2021-03-05  9:53 ` burnus at gcc dot gnu.org
2021-03-07 13:19 ` dominiq at lps dot ens.fr

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-57871-4-5MJydzdQNa@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).