Desire to allocate bit in DT_PARM bitmask for DEC FORMAT compatibility purposes
Steve Kargl
sgk@troutmask.apl.washington.edu
Sat Mar 24 16:04:00 GMT 2018
On Sat, Mar 24, 2018 at 09:18:52AM +0100, Jakub Jelinek wrote:
> On Fri, Mar 23, 2018 at 05:32:45PM -0400, Fritz Reese wrote:
> > Sorry I am a bit late on the discussion, I overlooked this chain of messages...
> >
> > > On Tue, Mar 20, 2018 at 12:41:25PM -0600, Jeff Law wrote:
> > > Because this is a case where where a compile-time flag needs to affect
> > > the runtime, we need to communicate to the runtime that the magic
> > > compile-time flag is on.
> > >
> > > We have two general approaches for this kind of communication. One is
> > > to set a mask within the DT_PARM which gets passed into the runtime at
> > > the call site. The other is to marshall the flags in
> > > gfortran_set{args,options} on a global basis.
> >
> > My first thought is whether we need to reserve a new bit at all. Since
> > allowing a default for zero-width format specifiers doesn't seem
> > terribly harmful, perhaps we could lump it into -std=legacy? The
> > standard flags are already passed to the runtime, so no additional
> > information would be required. I believe this would simplify the
> > implementation on top of saving the last few DT_PARM bits.
>
> The default is
> warn_std = GFC_STD_LEGACY | GFC_STD_F95_DEL;
> allow_std = GFC_STD_*; // all
> pedantic = 0;
>
> So if we use e.g. notify_std (..., GFC_STD_LEGACY, ...) for this,
> it would not warn at all by default, and would ever warn only if using
> -pedantic. Is that what we want for this extension?
>
> 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.
> Any way to deal with the FMT_L missing width inconsistency (libgfortran
> under notify_std (..., GFC_STD_GNU, ...) using default length of 1 while
> the other compilers all using 2?
fmt->value = flag_dec ? 2 : 1; /* Default width */
--
Steve
20170425 https://www.youtube.com/watch?v=VWUpyCsUKR4
20161221 https://www.youtube.com/watch?v=IbCHE-hONow
More information about the Fortran
mailing list