From: Piotr Trojanek Date: Mon, 19 Jan 2026 22:04:10 +0000 (+0100) Subject: ada: Reject pragma CPU and Priority that duplicate corresponding aspects X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03fb45556c2b0da81ef0e7fceb2b56a47fb9d94a;p=thirdparty%2Fgcc.git ada: Reject pragma CPU and Priority that duplicate corresponding aspects When a main subprogram had its CPU or priority specified first by an aspect specification and then by a corresponding pragma, then the pragma was silently ignored. Now such a pragma is rejected. gcc/ada/ChangeLog: * sem_ch13.adb (Analyze_Aspect_Specifications): Record aspect CPU and Priority applied to subprogram as a representation item. --- diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 7c13299f85f..158bdb1c516 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -4275,6 +4275,11 @@ package body Sem_Ch13 is Discard_Node (RTE (RE_Activate_Tasks)); end if; + -- Record aspect specification as a representation item + -- to detect pragmas that would duplicate it. + + Record_Rep_Item (E, Aspect); + -- Handling for these aspects in subprograms is complete goto Continue;