From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 128E73858D34; Thu, 23 Sep 2021 19:28:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 128E73858D34 From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/102458] ICE tree check: expected array_type, have pointer_type in gfc_conv_array_initializer, at fortran/trans-array.c:6136 Date: Thu, 23 Sep 2021 19:28:17 +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: anlauf at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: anlauf at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to bug_status 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2021 19:28:18 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102458 anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |anlauf at gcc dot g= nu.org Status|NEW |ASSIGNED --- Comment #9 from anlauf at gcc dot gnu.org --- (In reply to Steve Kargl from comment #8) > I think TRANSFER needs to be handled differently. >=20 > From the same section of the Fortran standard, TRANSFER is > rejected if the following does not apply. >=20 > (8) a reference to the intrinsic function TRANSFER where each > argument is a constant expression and each ultimate pointer > component of the SOURCE argument is disassociated, yeah, I did that for the final patch. Will submit soon. > So, one should be able to do something like >=20 > integer,parameter :: n =3D 4 > integer,parameter :: x(transfer(n, n)) =3D 1 > print *, x > end >=20 > which gfortran will give=20 >=20 > % gfortran10 -o z a.f90 > % ./z > 1 1 1 1 This is less of an issue. We also currently fail on the following: subroutine s4 integer, parameter :: n =3D 4 integer, parameter :: x(transfer(n, n)) =3D 1 ! legal integer :: y(transfer(n, n)) =3D 2 ! legal integer, parameter :: k =3D size (x) ! ok integer, parameter :: m =3D size (y) ! fails, tracked separately print *, k, x, y if (k /=3D size (y)) stop 1 end For some reason we do not simplify SIZE(y), and this reason lies elsewhere. And it is not touch by my patch. > If you remove TRANSFER from the patch, it looks good to me. > We can revisit TRANSFER when Gerhard breaks gfortran, again! ;-) I'll bet he does, but don't hold your breath?=