From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id 77F223858439; Fri, 4 Nov 2022 13:53:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 77F223858439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667570001; bh=qigGUNZwTjDa4p81gU4B1te88/SMKfEYClE+DnWqLSQ=; h=From:To:Subject:Date:From; b=YLCNjEbu+1SL/GCa2KKee7PhQPHnkQ9436RALgenh/NK0ioBR/lmJA4int8VERH4T tidbeh7HnVqMDZkwue0pEdQ3d2d5HrpqWklcZVKsv5g0lmXTiIwlEJGqsIuXEFBRpd sGx/haZPEY4QH7tPiwL67OrcOQQrU/fYCsmCDWpQ= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3655] ada: Reject expanded global names in lock-free protected objects X-Act-Checkin: gcc X-Git-Author: Piotr Trojanek X-Git-Refname: refs/heads/master X-Git-Oldrev: 8080a1b64ae6030bb85ce88486dc2447d3063b09 X-Git-Newrev: da1207fff99c4c20051d6f5e0f567da4335fc9a4 Message-Id: <20221104135321.77F223858439@sourceware.org> Date: Fri, 4 Nov 2022 13:53:21 +0000 (GMT) List-Id: https://gcc.gnu.org/g:da1207fff99c4c20051d6f5e0f567da4335fc9a4 commit r13-3655-gda1207fff99c4c20051d6f5e0f567da4335fc9a4 Author: Piotr Trojanek Date: Mon Oct 3 23:16:19 2022 +0200 ada: Reject expanded global names in lock-free protected objects Lock-free expansion of protected subprograms is only possible when there are no references to global assignable objects. We only detected such references when they appeared as direct names, but we must similarly detect expanded names. gcc/ada/ * sem_ch9.adb (Satisfies_Lock_Free_Requirements): Detect references via expanded names. Diff: --- gcc/ada/sem_ch9.adb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb index f2a59017865..5dee216256c 100644 --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -463,7 +463,7 @@ package body Sem_Ch9 is -- References - elsif Kind = N_Identifier + elsif Kind in N_Identifier | N_Expanded_Name and then Present (Entity (N)) then declare @@ -564,7 +564,7 @@ package body Sem_Ch9 is -- reference only one component of the protected type, plus -- the type of the component must support atomic operation. - if Kind = N_Identifier + if Kind in N_Identifier | N_Expanded_Name and then Present (Entity (N)) then declare