From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 83E963858C20; Mon, 29 Aug 2022 17:38:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83E963858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661794716; bh=uQg5/DQwABy1vv0b+W3KymjQX92YuEwm5gpoU67LgZ4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cChQov/KjegtUBVlJBn5LD8H6iRoEXtswdhDyyjW//Xc2o+6PJFoYoKODlE6KoCLu 50RGV6IMjDNYzVnuR7YxYvffXmW5dGkyJBWETL0U5qv0kHYPlQDg8ZeyIWFIR+3C/T EI9qhWyLA1W5Jvkljad3W4ZneDenNIWDC8Dgajr4= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/106771] [OOP] ICE with PACK intrinsic, in gfc_conv_expr_descriptor, at fortran/trans-array.c:7328 Date: Mon, 29 Aug 2022 17:38:36 +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: 9.2.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D106771 --- Comment #2 from anlauf at gcc dot gnu.org --- Playing a little, I found that the issue might be related to the elemental function isa. The following dumb replacement function isa(this,i) class(t), intent(in) :: this integer, intent(in) :: i(:) logical :: isa(size(i)) integer :: j do j =3D 1, size(i) if (i(j)>0 .and. i(j)<=3Dmerge(size(this%iloc),0,allocated(this%iloc= ))) then isa(j) =3D this%iloc(i(j))>0 else isa(j) =3D .false. end if end do end function isa also avoids the ICE.=