public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Harald Anlauf <anlauf@gmx.de>
To: Paul Richard Thomas <paul.richard.thomas@gmail.com>
Cc: "fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [Patch, fortran] PR98498 - Interp request: defined operators and unlimited polymorphic
Date: Thu, 2 Nov 2023 21:35:26 +0100	[thread overview]
Message-ID: <961bf613-316c-449b-87fe-bae6f1798410@gmx.de> (raw)
In-Reply-To: <CAGkQGiKa5fM53dy0Pj1au6LQdJLeGwfHOgi0r18CMfsPGLaiHA@mail.gmail.com>

Hi Paul,

Am 02.11.23 um 19:18 schrieb Paul Richard Thomas:
> Hi Harald,
>
> I was overthinking the problem. The rejected cases led me to a fix that can
> only be described as a considerable simplification compared with the first
> patch!

this patch is *much* simpler, makes more sense, and works here. :-)

> The testcase now reflects the requirements of the standard and
> regtests without failures.
>
> OK for mainline?

Yes, OK for mainline.

Thanks,
Harald

> Thanks
>
> Paul
>
> Fortran: Defined operators with unlimited polymorphic args [PR98498]
>
> 2023-11-02  Paul Thomas  <pault@gcc.gnu.org>
>
> gcc/fortran
> PR fortran/98498
> * interface.cc (upoly_ok): Defined operators using unlimited
> polymorphic formal arguments must not override the intrinsic
> operator use.
>
> gcc/testsuite/
> PR fortran/98498
> * gfortran.dg/interface_50.f90: New test.
>
>
> On Wed, 1 Nov 2023 at 20:12, Harald Anlauf <anlauf@gmx.de> wrote:
>
>> Hi Paul,
>>
>> Am 01.11.23 um 19:02 schrieb Paul Richard Thomas:
>>> The interpretation request came in a long time ago but I only just got
>>> around to implementing it.
>>>
>>> The updated text from the standard is in the comment. Now I am writing
>>> this, I think that I should perhaps use switch(op)/case rather than using
>>> if/else if and depending on the order of the gfc_intrinsic_op enum being
>>> maintained. Thoughts?
>>
>> the logic is likely harder to parse with if/else than with
>> switch(op)/case.  However, I do not think that the order of
>> the enum will ever be changed, as the module format relies
>> on that very order.
>>
>>> The testcase runs fine with both mainline and nagfor. I think that
>>> compile-only with counts of star-eq and star_not should suffice.
>>
>> I found other cases that are rejected even with your patch,
>> but which are accepted by nagfor.  Example:
>>
>>      print *, ('a' == c)
>>
>> Nagfor prints F at runtime as expected, as it correctly resolves
>> this to star_eq.  Further examples can be easily constructed.
>>
>> Can you have a look?
>>
>> Thanks,
>> Harald
>>
>>> Regtests with no regressions. OK for mainline?
>>>
>>> Paul
>>>
>>> Fortran: Defined operators with unlimited polymorphic args [PR98498]
>>>
>>> 2023-11-01  Paul Thomas  <pault@gcc.gnu.org>
>>>
>>> gcc/fortran
>>> PR fortran/98498
>>> * interface.cc (upoly_ok): New function.
>>> (gfc_extend_expr): Use new function to ensure that defined
>>> operators using unlimited polymorphic formal arguments do not
>>> override their intrinsic uses.
>>>
>>> gcc/testsuite/
>>> PR fortran/98498
>>> * gfortran.dg/interface_50.f90: New test.
>>>
>>
>>
>


      reply	other threads:[~2023-11-02 20:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-01 18:02 Paul Richard Thomas
2023-11-01 20:12 ` Harald Anlauf
2023-11-02 18:18   ` Paul Richard Thomas
2023-11-02 20:35     ` Harald Anlauf [this message]

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=961bf613-316c-449b-87fe-bae6f1798410@gmx.de \
    --to=anlauf@gmx.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=paul.richard.thomas@gmail.com \
    /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).