From: Harald Anlauf <anlauf@gmx.de>
To: gcc-patches@gcc.gnu.org
Cc: fortran@gcc.gnu.org
Subject: Re: [Patch, fortran] PR104555 - ICE in gfc_compare_derived_types, at fortran/interface.cc:628 since r10-2912-g70570ec192745095
Date: Sun, 29 Oct 2023 20:15:21 +0100 [thread overview]
Message-ID: <0de61835-de8e-4956-aae2-bd831c30e52a@gmx.de> (raw)
Message-ID: <20231029191521.qZpBs_i0zsOnQavv1UA8AtcsPJ4Z-1NPTn2LxdGk2dY@z> (raw)
In-Reply-To: <CAGkQGiKp=7tgx8mCgP+Sp80HfGi4VD-m-9fsd-GVxeY3a2aDAA@mail.gmail.com>
Hi Paul,
code->expr1->symtree->n.sym->ts = code->expr2->ts;
+ /* Sometimes the selector expression is given the typespec of the
+ '_data' field, which is logical enough but inappropraite here. */
s/inappropraite/inappropriate/
+ if (code->expr2->ts.type == BT_DERIVED
otherwise it LGTM.
Thanks for the patch!
Harald
On 10/29/23 13:29, Paul Richard Thomas wrote:
> Bizarrely, since the fix for pr101625, the testcase compiles and runs
> correctly with s/select type (y => x)/select type (y => (x))/ !
>
> The fix is straightforward and appears to be one of those wrinkles arising
> from the use of associate variables as a selector. The fault is reasonable
> since the expression is a reference to the _data field, which is of derived
> type. However, being a select type selector, the selector must be a
> class with that declared type.
>
> Regtests fine. OK for mainline?
>
> Paul
>
> Fortran: Fix a problem with SELECT TYPE selectors [PR104555].
>
> 2023-10-29 Paul Thomas <pault@gcc.gnu.org>
>
> gcc/fortran
> PR fortran/104555
> * resolve.cc (resolve_select_type): If the selector expression
> has no class component references and the expression is a
> derived type, copy the typespec of the symbol to that of the
> expression.
>
> gcc/testsuite/
> PR fortran/104555
> * gfortran.dg/pr104555.f90: New test.
>
next prev parent reply other threads:[~2023-10-29 19:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-29 12:29 Paul Richard Thomas
2023-10-29 19:15 ` Harald Anlauf [this message]
2023-10-29 19:15 ` Harald Anlauf
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=0de61835-de8e-4956-aae2-bd831c30e52a@gmx.de \
--to=anlauf@gmx.de \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
/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).