On Fri, Sep 22, 2017 at 10:11:55AM +0300, Janne Blomqvist wrote:
> On Fri, Sep 22, 2017 at 8:02 AM, Janus Weil <ja...@gcc.gnu.org> wrote:
> > Thanks, Steve. I'm attaching the updated ChangeLog and the two test
> > cases for the two new flags. Since this appears to be  a somewhat
> > controversial feature, I'll wait two more days to allow for others to
> > contribute their feedback (positive or negative). I'll commit on
> > Sunday if I hear nothing until then.
> 
> Well, if you're actively soliciting bikeshedding, here goes:
> 
> Since we're about to have several -fdefault-real-N flags, would it
> make sense to instead make a single flag -fdefault-real=SOMEVALUE (and
> for backwards compatibility, make -fdefault-real-8 an alias for
> -fdefault-real=8)? And similarly for -fdefault-double=.
> 
> And since the standard requires that double precision variables are
> twice as big as reals, in the absence of an explicit -fdefault-double=
> flag, would it make sense to have -fdefault-real=N imply
> -fdefault-double=[2*N or if that isn't supported on the target, the
> largest supported real kind]? (This is sort-of an extension of the
> current -fdefault-real-8 behavior)

The standard requires more than just double precision being twice
as big as default real.  Among other things, storage association
rules require default logical, integer, and real to all occupy
the same number of storage units.  The promotion of DOUBLE
PRECISION to REAL(16), if available, was my misguided attempt to
enforce storage assocation.  That is the essenses of why I think
these options should go away.

But, I understand Janus's position that -fdefault-real-16 allows
a developer to quickly test whether an algorithm works and/or is
stable at higher precision.  The unfortunate side-effect is that
a developer finds that the result of the option appears to work,
so the developer never reviews the actual code.  It is not uncommon
to find old code of the form

       REAL EPS, NEW, OLD
       PARAMETER(EPS=1.E-8)
       ...
C      TEST FOR CONVERGENCE
       IF (ABS(NEW-OLD).LT.EPS) THEN

Is the convergence criteria still correct for -fdefault-real-16?
Only a developer reviewing and properly porting the code to a 
higher precision can make that decision.

-- 
Steve
20170425 https://www.youtube.com/watch?v=VWUpyCsUKR4
20161221 https://www.youtube.com/watch?v=IbCHE-hONow

Reply via email to