Hi Harald,

This is the output from a completely tedious Zoom meeting:

  /* From F2003 onwards, intrinsic procedures are no longer subject to
     the restriction, "that an elemental intrinsic function here be of
     type integer or character and each argument must be an initialization
     expr of type integer or character" is lifted so that intrinsic
     procedures can be over-ridden. This requires that the intrinsic
     symbol not appear in the module file, thereby preventing ambiguity
     when USEd.  */
  if (strcmp (sym->module, "(intrinsic)") == 0
      && (gfc_option.allow_std & GFC_STD_F2003))
    return;

Modify or replace the comment, as desired. The change to the condition
gives the desired result in terms of standard compliance.

Regards

Paul


On Fri, 16 Apr 2021 at 09:32, Paul Richard Thomas <
paul.richard.tho...@gmail.com> wrote:

> Hi All,
>
> Harald, that is to say the least of it an elegant and minimalist fix. With
> the patch applied, gfortran behaves like the "other brand" and regtests OK.
>
> Bernhard correctly points out that there should be a comment. Not only
> this, there must be an F2003 standard check, since F95 forbids over-riding
> of elemental intrinsics.
>
> I see as I am writing that Tobias has dealt with the point about module
> version. I agree entirely with Tobias. The fact that the patch is
> permissive in suppressing an incorrect error means that it cannot break
> anything.
>
> This patch, once modified as above, should be pushed to master right
> immediately and, since it affects F2003 compliance, backported to 10-branch.
>
> Many thanks, Harald - good work!
>
> Paul
>
>
>
>
>
> On Fri, 16 Apr 2021 at 08:41, Bernhard Reutner-Fischer via Fortran <
> fortran@gcc.gnu.org> wrote:
>
>> On Thu, 15 Apr 2021 22:52:01 +0200
>> Harald Anlauf via Fortran <fortran@gcc.gnu.org> wrote:
>>
>> > Hello everybody,
>> >
>> > we currently write the interface for intrinsic procedures to module
>> > files although that should not be necessary.  (F2018:15.4.2.1 actually
>> > states that interfaces e.g. of intrinsic procedures are 'explicit'.)
>> > This lead to bogus errors due to an apparently bogus ambiguity.
>> > A simple solution is to just avoid writing that (redundant) information
>> > to the module file.
>>
>> I'd put the standard reference you cite in a comment before the check.
>>
>> Does this change the module format in an incompatible way, i.e. does
>> this require a module format version bump?
>>
>> What happens when we read an existing module that names an intrinsic?
>> Without bumping the module version, we'd run into the same issue as
>> before, don't we?
>>
>> If we did not bump the module version yet for gcc-11 then i would
>> suggest to defer the patch for gcc-12 and bump then.
>>
>> Even if we'd skip reading existing intrinsic now, we'd break interop
>> with older compiler versions if we would stop writing them without
>> bumping the module format, i think?
>>
>> > Regtested on x86_64-pc-linux-gnu.  OK for (current) mainline?
>> > Or rather wait after 11 release?
>> >
>> > Thanks,
>> > Harald
>>
>
>
> --
> "If you can't explain it simply, you don't understand it well enough" -
> Albert Einstein
>


-- 
"If you can't explain it simply, you don't understand it well enough" -
Albert Einstein

Reply via email to