From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 361AD3857C4E; Mon, 16 May 2022 08:43:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 361AD3857C4E MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Pierre-Marie de Rodat To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-484] [Ada] Fix internal error on mix of controlled and protected types X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: 861b78a946b0d0936baed97fb17fe3c7b300a8c5 X-Git-Newrev: 146ea83af978384b0f7dabc8176f8bf98892ce2a Message-Id: <20220516084342.361AD3857C4E@sourceware.org> Date: Mon, 16 May 2022 08:43:42 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2022 08:43:42 -0000 https://gcc.gnu.org/g:146ea83af978384b0f7dabc8176f8bf98892ce2a commit r13-484-g146ea83af978384b0f7dabc8176f8bf98892ce2a Author: Eric Botcazou Date: Thu Mar 10 11:11:32 2022 +0100 [Ada] Fix internal error on mix of controlled and protected types The key is that the protected type is a (limited) private type, which fools a test in Cleanup_Scopes. gcc/ada/ * inline.adb (Cleanup_Scopes): Test the underlying type. Diff: --- gcc/ada/inline.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 5944aed0b00..a1d22544874 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -2773,7 +2773,7 @@ package body Inline is Scop := Protected_Body_Subprogram (Scop); elsif Is_Subprogram (Scop) - and then Is_Protected_Type (Scope (Scop)) + and then Is_Protected_Type (Underlying_Type (Scope (Scop))) and then Present (Protected_Body_Subprogram (Scop)) then -- If a protected operation contains an instance, its cleanup