From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ED5A3385CC97; Tue, 10 Oct 2023 15:12:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ED5A3385CC97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696950739; bh=issrP5QskhSy08AUtsqTOfLnED/HWZo8cuGEaFtKWH8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=i1P5HEeFdZZs5jrto7arpraszegtZQcXZakj4TKEzyjmWqPHBG1/I3lGOsNPjqUnG RV2gE5OpRfAUQkHtTqzWuQToD1d1xamaaRut0wN3Z3Be7IUSQMXi8B5If+xaZReLGZ D9kCsbEeU64tu2bgLiT7Ha6O1xavF/VRMw+E3Wng= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/111434] [13/14 regression] infinite loop with multiple limited with clauses Date: Tue, 10 Oct 2023 15:12:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ebotcazou 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=3D111434 --- Comment #4 from CVS Commits --- The releases/gcc-13 branch has been updated by Eric Botcazou : https://gcc.gnu.org/g:8a5fe7fc0c4aecca1fec88b7aa608745ade1b045 commit r13-7942-g8a5fe7fc0c4aecca1fec88b7aa608745ade1b045 Author: Eric Botcazou Date: Tue Sep 26 22:54:12 2023 +0200 ada: Fix infinite loop with multiple limited with clauses This occurs when one of the types has an incomplete declaration in addi= tion to its full declaration in its package. In this case AI05-129 says that= the incomplete type is not part of the limited view of the package, i.e. on= ly the full view is. Now, in the GNAT implementation, it's the opposite in= the regular view of the package, i.e. the incomplete type is the visible on= e. That's why the implementation needs to also swap the types on the visibility chain while it is swapping the views when the clauses are either instal= led or removed. This works correctly for the installation, but does not for= the removal, so this change rewrites the code doing the latter. gcc/ada/ PR ada/111434 * sem_ch10.adb (Replace): New procedure to replace an entity wi= th another on the homonym chain. (Install_Limited_With_Clause): Rename Non_Lim_View to Typ for t= he sake of consistency. Call Replace to do the replacements and s= plit the code into the regular and the special cases. Add debuggging output controlled by -gnatdi. (Install_With_Clause): Print the Parent_With and Implicit_With flags in the debugging output controlled by -gnatdi. (Remove_Limited_With_Unit.Restore_Chain_For_Shadow (Shadow)): Rewrite using a direct replacement of E4 by E2. Call Replace to do the replacements. Add debuggging output controlled by -gnatdi.=