From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 967BA386F45A; Fri, 5 Mar 2021 18:56:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 967BA386F45A From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/97927] gfortran: ICE in lookup_field_for_decl, at tree-nested.c:288 Date: Fri, 05 Mar 2021 18:56:27 +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.2.1 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus 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: 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: Fri, 05 Mar 2021 18:56:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97927 --- Comment #13 from Tobias Burnus --- Created attachment 50313 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50313&action=3Dedit Reduced testcase - run with 'gfortran file.f90' (seems to require --enable-checking=3Dyes) The generated code has: __attribute__((fn spec (". "))) void zrho2 () // <<--- nested in exxengy { return; } __attribute__((fn spec (". "))) void exxengy () { static void zrho2 (void); ierror =3D {CLOBBER}; mpi_allreduce (&ierror); } ICE: In tree-nested.c's convert_local_reference_stmt, there is: 2524 case GIMPLE_ASSIGN: 2525 if (gimple_clobber_p (stmt)) 2526 { 2527 tree lhs =3D gimple_assign_lhs (stmt); 2528 if (DECL_P (lhs) 2529 && !use_pointer_in_frame (lhs) 2530 && lookup_field_for_decl (info, lhs, NO_INSERT)) with: (gdb) p debug_gimple_seq(*gsi->seq) ierror =3D {CLOBBER}; mpi_allreduce (&ierror); and lhs =3D=3D decl in the following: #0 lookup_field_for_decl (info=3D0x2f28150, decl=3D0x7ffff7ffbab0, insert=3DNO_INSERT) at ../../repos/gcc/gcc/tree-nested.c:385 385 gcc_checking_assert (decl_function_context (decl) =3D=3D info->co= ntext); with (gdb) p debug_tree(info->context) unit-size align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7ffff74a95e8 precision:32 min max pointer_to_this > addressable used public static SI exxengy4.f90:12:16 size unit-size align:32 warn_if_not_align:0 context chain > I am not quite sure whether the context is right or not: context =20 but it does not really look wrong, does it?=