From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 4C0AD398A87D; Wed, 16 Jun 2021 08:45:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C0AD398A87D 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 r12-1509] [Ada] Non-static Interrupt_Priority allowed with restriction Static_Priorities X-Act-Checkin: gcc X-Git-Author: Justin Squirek X-Git-Refname: refs/heads/master X-Git-Oldrev: f5b4b6bf14a571df07021936c29b4773beb80324 X-Git-Newrev: c5dc00ef38d2c3ac647726b0215888f75b0e4d9c Message-Id: <20210616084508.4C0AD398A87D@sourceware.org> Date: Wed, 16 Jun 2021 08:45:08 +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: Wed, 16 Jun 2021 08:45:08 -0000 https://gcc.gnu.org/g:c5dc00ef38d2c3ac647726b0215888f75b0e4d9c commit r12-1509-gc5dc00ef38d2c3ac647726b0215888f75b0e4d9c Author: Justin Squirek Date: Sat Feb 27 19:09:48 2021 -0500 [Ada] Non-static Interrupt_Priority allowed with restriction Static_Priorities gcc/ada/ * sem_ch13.adb (Make_Aitem_Pragma): Check for static expressions in Priority aspect arguments for restriction Static_Priorities. Diff: --- gcc/ada/sem_ch13.adb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 8aa62c89deb..4fa17f1ddb4 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -3382,6 +3382,13 @@ package body Sem_Ch13 is | Aspect_Interrupt_Priority | Aspect_Priority => + -- Verify the expression is static when Static_Priorities is + -- enabled. + + if not Is_OK_Static_Expression (Expr) then + Check_Restriction (Static_Priorities, Expr); + end if; + if Nkind (N) in N_Subprogram_Body | N_Subprogram_Declaration then -- Analyze the aspect expression