From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AC3703858428; Thu, 13 Jul 2023 19:24:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AC3703858428 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689276273; bh=e+gdaWgcCD1jGINDTmUnPjkimsuDvkKvvVjedB1W0gE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vv2nPQK6xvIHIaPe81/TZIsIpTu7tTuCa1lkcremvTUhejV804B3DJMcJ/F659ktx KB62ClG6CAOaz7NfP+VC/yqdlrZRLleucI7npCP9EcwQxRKbnohkgJxCBgo3u7IAgK VSelGw2gfNekZG1ldwuPsP1uNAr6AMccYEv18k/k= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/106050] ICE in reject_statement, at fortran/parse.cc:2879 since r8-3056-g5bab4c9631c478b7 Date: Thu, 13 Jul 2023 19:24:32 +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: 13.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: mikael 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=3D106050 --- Comment #8 from CVS Commits --- The master branch has been updated by Mikael Morin : https://gcc.gnu.org/g:616a101848bfd5b61ffdd87ae9b1153139d916ca commit r14-2507-g616a101848bfd5b61ffdd87ae9b1153139d916ca Author: Mikael Morin Date: Thu Jul 13 21:23:44 2023 +0200 fortran: Release symbols in reversed order [PR106050] Release symbols in reversed order wrt the order they were allocated. This fixes an error recovery ICE in the case of a misplaced derived type declaration. Such a declaration creates nested symbols, one for the derived type and one for each type parameter, which should be immediately released as the declaration is rejected. This breaks if the derived type is released first. As the type parameter symbols are in the namespace of the derived type, releasing the derived type releases the type parameters, so one can't access them after that, even to release them. Hence, the type parameters should be released first. PR fortran/106050 gcc/fortran/ChangeLog: * symbol.cc (gfc_restore_last_undo_checkpoint): Release symbols in reverse order. gcc/testsuite/ChangeLog: * gfortran.dg/pdt_33.f90: New test.=