public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kargl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/103413] [10/11/12/13 Regression] ICE: Invalid expression in gfc_element_size since r10-2083-g8dc63166e0b85954
Date: Tue, 25 Oct 2022 21:44:01 +0000 [thread overview]
Message-ID: <bug-103413-4-cuSOKma3xS@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103413-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103413
--- Comment #10 from kargl at gcc dot gnu.org ---
(In reply to anlauf from comment #9)
> Steve,
>
> what do you think about the following patch? Not yet fully regtested.
> It should fix the issue much simpler by checking type compatibility:
>
> diff --git a/gcc/fortran/symbol.cc b/gcc/fortran/symbol.cc
> index 6050359d521..f4052eb7042 100644
> --- a/gcc/fortran/symbol.cc
> +++ b/gcc/fortran/symbol.cc
> @@ -5139,6 +5141,9 @@ gfc_type_compatible (gfc_typespec *ts1, gfc_typespec
> *ts2)
> bool is_union1 = (ts1->type == BT_UNION);
> bool is_union2 = (ts2->type == BT_UNION);
>
> + if (ts2->type == BT_BOZ)
> + return (ts1->type == BT_INTEGER || ts1->type == BT_REAL);
> +
> if (is_class1
> && ts1->u.derived->components
> && ((ts1->u.derived->attr.is_class
>
> Do you have a testcase that exercises BT_INTEGER and BT_REAL here?
> I thought that one of the pathes that reaches gfc_boz2int and gfc_boz2real
> might need the above.
Well, a boz is typeless, so it cannot be compatible with any other type.
So, I would assume, you could do
if (ts1->type == BT_BOZ || ts2->type == BT_BOZ)
return false;
There is a caveat in that Fortran 2023 is going to allow
things like
real :: x = z'1234'
if gfc_type_compatible is used in simple assignments, gfortran will
need to deal with that.
next prev parent reply other threads:[~2022-10-25 21:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-24 17:46 [Bug fortran/103413] New: [10/11/12 Regression] ICE: Invalid expression in gfc_element_size gscfq@t-online.de
2021-11-24 18:15 ` [Bug fortran/103413] " kargl at gcc dot gnu.org
2021-11-24 23:21 ` kargl at gcc dot gnu.org
2021-11-25 7:17 ` rguenth at gcc dot gnu.org
2021-11-25 9:55 ` [Bug fortran/103413] [10/11/12 Regression] ICE: Invalid expression in gfc_element_size since r10-2083-g8dc63166e0b85954 marxin at gcc dot gnu.org
2022-06-28 10:47 ` [Bug fortran/103413] [10/11/12/13 " jakub at gcc dot gnu.org
2022-06-28 14:55 ` kargl at gcc dot gnu.org
2022-06-29 8:11 ` marxin at gcc dot gnu.org
2022-06-29 14:46 ` sgk at troutmask dot apl.washington.edu
2022-06-30 12:07 ` marxin at gcc dot gnu.org
2022-10-25 20:22 ` anlauf at gcc dot gnu.org
2022-10-25 21:44 ` kargl at gcc dot gnu.org [this message]
2022-10-26 18:24 ` anlauf at gcc dot gnu.org
2022-10-26 19:05 ` sgk at troutmask dot apl.washington.edu
2022-10-26 19:21 ` anlauf at gcc dot gnu.org
2022-10-26 19:22 ` anlauf at gcc dot gnu.org
2022-10-26 20:30 ` sgk at troutmask dot apl.washington.edu
2022-10-26 20:31 ` cvs-commit at gcc dot gnu.org
2022-10-28 20:38 ` cvs-commit at gcc dot gnu.org
2022-10-28 20:48 ` cvs-commit at gcc dot gnu.org
2022-10-28 20:57 ` cvs-commit at gcc dot gnu.org
2022-10-28 20:58 ` anlauf at gcc dot gnu.org
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=bug-103413-4-cuSOKma3xS@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@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).