public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Jerry DeLisle <jvdelisle@charter.net>,
	sgk@troutmask.apl.washington.edu,
	Jakub Jelinek <jakub@redhat.com>
Cc: Fritz Reese <fritzoreese@gmail.com>,
	Janne Blomqvist <blomqvist.janne@gmail.com>,
	Fortran List <fortran@gcc.gnu.org>
Subject: Re: Desire to allocate bit in DT_PARM bitmask for DEC FORMAT compatibility purposes
Date: Sun, 25 Mar 2018 18:48:00 -0000	[thread overview]
Message-ID: <77fd734d-ad46-4f37-6af7-0b4919cf92ba@redhat.com> (raw)
In-Reply-To: <6763dfb8-426d-8be6-319e-ba947ea425d7@charter.net>

On 03/24/2018 12:20 PM, Jerry DeLisle wrote:
> On 03/24/2018 10:11 AM, Steve Kargl wrote:
>> On Sat, Mar 24, 2018 at 05:20:06PM +0100, Jakub Jelinek wrote:
>>> On Sat, Mar 24, 2018 at 09:04:04AM -0700, Steve Kargl wrote:
>>>>> Or shall we just check (warn_std & GFC_STD_LEGACY) != 0, if true,
>>>>> set fmt->error if width etc. is missing, otherwise use the -1 and
>>>>> later
>>>>> resolve it to the default?
>>>>
>>>> No.  DEC extensions should be activated by the use of one of the
>>>> -fdec-* options.  For this extension, I think it can be grouped
>>>> under the general purpose -fdec option.  In the Fortran FE, -fdec
>>>> then becomes "if (flag_dec)".  I don't recall if Fritz set up
>>>> passing flag_dec into libgfortran.
>>>
>>> I don't see it passed directly.
>>> With -fdec compile_options.warn_std is 0, rather than the default
>>> GFC_STD_LEGACY | GFC_STD_F95_DEL, but _gfortran_set_options
>>> argument is exactly the same for -fdec and for -std=legacy, so there
>>> is no
>>> way to differentiate the two.
>>>
>>> So, the only way to handle this DEC extension without adding new bits
>>> (to either compile_options (i.e. GFC_STD_*), or the io flags as shown
>>> by the
>>> patch Jeff posted) would be to abuse the IOPARM_dt_default_exp bit
>>> for it,
>>> i.e. tie together the extension omitting exponent and the default width.
>>> Seems the IOPARM_dt_default_exp is set whenever -fdec and not otherwise:
>>>
>>
>> Well, if we add
>>
>> #define GFC_STD_DEC_EXT        (1<<13)
>>
>> to fortran/libgfortran.h, we still have 18 bits left.
>>
>> Then change options.c(set_dec_flags) to include this in the
>> list of "standards" passed to libgfortran.  The tests would
>> then look like
>>
>>     fmt->value = (gfc_option.allow_std & GFC_STD_DEC_EXT) ? 2 : 1;
>>
>> I don't know if this is any better than using Jeff's idea of reserving
>> bit #28 in flag (and adding a flag2).  Other than 18 bits at 5 to 8
>> years per revision to the standards, means we'll be long retired
>> before someone has to deal with running out of bits.
>>
> 
> I like this approach because we can then use it for anything else that
> crops up down the road for the runtime.
In this scenario we communicate between the compiler and runtime via the
ALLOW_STD field.  The technical difference is the change applies
globally rather than on per-call basis (DT_PARMs IIUC is computed and
passed to the runtime for each format call).  I think that's likely to
be OK.

The downside of this approach is it puts these extensions under the -std
namespace rather than in -fdec.  I think Steve K. has expressed a desire
to keep this stuff under -fdec.  I'm not sure how to reconcile the
difference of opinions here.

I'm happy to go with either approach (or even generalizing the default
exponent code).  What's important to me is that we reach agreement on
the mechanism we're using for communication between the compiler and
runtime.

Jeff

  reply	other threads:[~2018-03-25 18:48 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-20 18:41 Jeff Law
2018-03-21 18:35 ` Jakub Jelinek
2018-03-21 17:29   ` Jeff Law
2018-03-21 18:38     ` Janne Blomqvist
2018-03-21 19:26       ` Jeff Law
2018-03-22  5:49       ` Jeff Law
2018-03-23  2:07         ` Jerry DeLisle
2018-03-23  9:02           ` Janne Blomqvist
2018-03-23  9:08             ` Jakub Jelinek
2018-03-23 14:22             ` Jerry DeLisle
2018-03-23  9:35           ` Jakub Jelinek
2018-03-23  8:39             ` Jakub Jelinek
2018-03-23 14:46               ` Jerry DeLisle
2018-03-23 19:12               ` Jeff Law
2018-03-23  9:35             ` Jakub Jelinek
2018-03-23 13:26             ` Lukasz Kolodziejczyk
2018-03-23 14:47               ` Jerry DeLisle
2018-03-23 19:39               ` Jeff Law
2018-03-23 21:36                 ` Steve Kargl
2018-03-23 19:58             ` Jeff Law
2018-03-23 21:32               ` Fritz Reese
2018-03-24  9:35                 ` Jakub Jelinek
2018-03-24 16:04                   ` Steve Kargl
2018-03-24 17:35                     ` Jakub Jelinek
2018-03-24 17:11                       ` Steve Kargl
2018-03-24 18:20                         ` Jerry DeLisle
2018-03-25 18:48                           ` Jeff Law [this message]
2018-03-25 19:09                             ` Jerry DeLisle
2018-03-26  3:41                               ` Jeff Law
2018-03-26  3:44                             ` Steve Kargl
2018-03-26  7:42                               ` Jakub Jelinek
2018-03-26 12:14                                 ` Fritz Reese
2018-03-26 19:15                                 ` Steve Kargl
2018-03-26 21:04                                   ` Jeff Law
2018-03-26 21:03                                 ` Jeff Law
2018-03-27  9:14                                   ` Jakub Jelinek
2018-03-28  1:02                                     ` Jerry DeLisle
2018-03-23 19:56           ` Jeff Law

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=77fd734d-ad46-4f37-6af7-0b4919cf92ba@redhat.com \
    --to=law@redhat.com \
    --cc=blomqvist.janne@gmail.com \
    --cc=fortran@gcc.gnu.org \
    --cc=fritzoreese@gmail.com \
    --cc=jakub@redhat.com \
    --cc=jvdelisle@charter.net \
    --cc=sgk@troutmask.apl.washington.edu \
    /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).