From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 423E4394443F; Wed, 8 Apr 2020 14:45:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 423E4394443F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1586357158; bh=AidTKyBO6TVtR2Nxt3xSgXuBTrMH8x0b9RSvrCgFPxg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HCPtS35VTwZ9sc+BdpRY+LZn4CQdWbiHhG5M0vETbCyFntLdhhvOfncVwJovQ977R dx1d21Kzuz1TwqcmqYcmiLEoPImqz2n+fKvISU9KyILkvwOuWa8Ra0lSJ01JJuvYPw HgUYWz9E7nc2xJ7jze5SVWjpA7MYVE8r/g1rHOts= From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/93339] [9/10 Regression] ICE in gimplify_var_or_parm_decl, at gimplify.c:2830 Date: Wed, 08 Apr 2020 14:45:57 +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: 10.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org 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: 9.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc attachments.created 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: Wed, 08 Apr 2020 14:45:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D93339 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org --- Comment #4 from Tobias Burnus --- Created attachment 48243 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D48243&action=3Dedit Extended test case I have tried with GCC 7 =E2=80=93 while some variants to not crash, others = do and it also does not work at run time. The full test case shows the same compile-t= ime error as trunk (see last item in this comment). Hence, it is not a "real" regression. * * *=20 The problem is at associate (y =3D> x%a) here, expr =3D "x%a" but expr->ts.u.cl->backend_decl =3D=3D ".z". When processing "associate (y =3D> x%a)", gfc_get_array_span() gets the descriptor (desc) and the "expr" from above as input. (When called from trans_associate_var.) Thus, one ends up with: integer(kind=3D8) .y; struct array01_unknown y; y =3D x.a; y.span =3D .z; // should be .y instead (+ at some point initialized) If one uses "y =3D> x%a(:)(1:3)", one gets: .z =3D 3 Hence, .z is no longer uninitialized. Still, '.z' is not defined in this sc= ope =E2=86=92 which causes the ICE. If one only has only one ASSOCIATE, this works has there is only a '.y'. In the attached test case (when commenting the two inner associate): 'y =3D x%a(:)(1:3)' works but 'y2 =3D> x%a' fails at the run-time check as 'y =3D=3D ['AB','CD'] in= stead of ['ABC','DEF'] (why?) * * * Additionally, there are odd errors for the inner associate, which does not = show up for the outer associate; it might be well related to the expr->ts.u.cl issue, but could also be an issue of its own.=20=20 associate (z =3D> x%a(:)(1:2)) 1 Error: Substring end index at (1) exceeds the string length foo3.f90:18:31: associate (z =3D> x%a(:)(1:2)) 1 Error: Entity =E2=80=98z=E2=80=99 at (1) has a deferred type parameter and = requires either the POINTER or ALLOCATABLE attribute=