]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Reject pragma CPU and Priority that duplicate corresponding aspects
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 19 Jan 2026 22:04:10 +0000 (23:04 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 25 May 2026 08:28:12 +0000 (10:28 +0200)
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.

gcc/ada/sem_ch13.adb

index 7c13299f85f1d07fa6082ec48f17e9e690a48923..158bdb1c516614c0d512eab5844bf82519e6f13b 100644 (file)
@@ -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;