From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4E62F3885508; Wed, 26 Oct 2022 19:05:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E62F3885508 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666811158; bh=hrAJESmx3V6R6nFl9n9r8T3Cpeal3xT96YtgHFC+m/w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iYbtxwrYSBK5v1L8qmebHn3mm/nRA0y3/RytQWRD4T3U5oLhBEqIPpjTPJehTW1BK N16iD9oWUXF2nZ1lIzsT6VJHNELvb7gOoiGkBqOKzW4zWh8NgxnHSwEDk3u/kLPVxG 8CgF6ohAPFMEDyVoHWuR8zUoZvGLyyvdUVY9tguo= From: "sgk at troutmask dot apl.washington.edu" 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: Wed, 26 Oct 2022 19:05:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: sgk at troutmask dot apl.washington.edu X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103413 --- Comment #12 from Steve Kargl = --- On Wed, Oct 26, 2022 at 06:24:04PM +0000, anlauf at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103413 >=20 > --- Comment #11 from anlauf at gcc dot gnu.org --- > (In reply to kargl from comment #10) > > Well, a boz is typeless, so it cannot be compatible with any other type. > > So, I would assume, you could do=20 > >=20 > > if (ts1->type =3D=3D BT_BOZ || ts2->type =3D=3D BT_BOZ) > > return false; >=20 > Yes, that's better. >=20 > > There is a caveat in that Fortran 2023 is going to allow > > things like > >=20 > > real :: x =3D z'1234' > >=20 > > if gfc_type_compatible is used in simple assignments, gfortran will > > need to deal with that. >=20 > It is currently not used in those cases. Hmmm, I wonder if there is duplicate code within gfortran that re-implements gfc_type_compatible. If time permits,=20 I'll see what comes with a grep of "->type =3D=3D *->type". > The following is already rejected: >=20 > program p > real :: r > data r / z'1234' / > r =3D z'1234' > print *, r > end >=20 > pr103413-boz.f90:3:18: >=20 > 3 | data r / z'1234' / > | 1 > Error: BOZ literal constant near (1) cannot be assigned to a REAL variabl= e [see > '-fno-allow-invalid-boz'] F2018 If a data-stmt-constant is a boz-literal-constant, the corresponding variable shall be of type integer. F2023 is unchanged. > pr103413-boz.f90:4:6: >=20 > 4 | r =3D z'1234' > | 1 > Error: BOZ literal constant at (1) is neither a DATA statement value nor = an > actual argument of INT/REAL/DBLE/CMPLX intrinsic subprogram [see > '-fno-allow-invalid-boz'] This I need to look up in F2023. The statement may be allowed only in an initialization expression. > Interestingly, -fno-allow-invalid-boz is not an allowed option... > But even when using -fallow-invalid-boz, which degrades the above > to a warning, I never get to gfc_type_compatible. The lack of -fno-allow-invalid-boz was intentional. A BOZ in an invalid context is an error. -fallow-invalid-boz allows that invalid context, but issues a warning. The only way to disable the warning is with -w (ie., you disable all warnings).=