https://gcc.gnu.org/g:03fb45556c2b0da81ef0e7fceb2b56a47fb9d94a

commit r17-748-g03fb45556c2b0da81ef0e7fceb2b56a47fb9d94a
Author: Piotr Trojanek <[email protected]>
Date:   Mon Jan 19 23:04:10 2026 +0100

    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:
---
 gcc/ada/sem_ch13.adb | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 7c13299f85f1..158bdb1c5166 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;

Reply via email to