From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 20CE0385773C; Tue, 10 Oct 2023 12:14:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 20CE0385773C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696940082; bh=IUHoj8Ej4lWnspqjDIS8XjxjvNHNZx5vM5QMYkZAWi0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=toBKYEOExfByXgdyBcKVnhJzeJYsou3n+GvrbVVDEPva9X+hqwkzrxNKn8BjT2dGF UK212uLoyd6UHnl+8YUXfNXHd/Yo2+3P3IaBofyYV2VCZzdqz1xnYMmxHjG9rwBwJw a22mRqFsmSfx8HEf0NbrxbDb9cTGmZRk5fY+b7tY= 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 12:14:41 +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 #3 from CVS Commits --- The master branch has been updated by Marc Poulhi?s : https://gcc.gnu.org/g:6bd83c90191a512d2c9094623248219d610b4372 commit r14-4532-g6bd83c90191a512d2c9094623248219d610b4372 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.=