aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_prag.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_prag.adb')
-rw-r--r--gcc/ada/sem_prag.adb37
1 files changed, 25 insertions, 12 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index d011760..eb1dbd1 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -11545,19 +11545,32 @@ package body Sem_Prag is
-- be expanded in the init proc. If expansion is enabled, then
-- perform semantic checks on a copy only.
- if Expander_Active then
- declare
- Temp : constant Node_Id :=
- New_Copy_Tree (Get_Pragma_Arg (Arg2));
- begin
- Set_Parent (Temp, N);
- Preanalyze_And_Resolve (Temp, RTE (RE_Interrupt_ID));
- end;
+ declare
+ Temp : Node_Id;
+ Typ : Node_Id;
+ Parg2 : constant Node_Id := Get_Pragma_Arg (Arg2);
- else
- Analyze (Get_Pragma_Arg (Arg2));
- Resolve (Get_Pragma_Arg (Arg2), RTE (RE_Interrupt_ID));
- end if;
+ begin
+ -- In Relaxed_RM_Semantics mode, we allow any static
+ -- integer value, for compatibility with other compilers.
+
+ if Relaxed_RM_Semantics
+ and then Nkind (Parg2) = N_Integer_Literal
+ then
+ Typ := Standard_Integer;
+ else
+ Typ := RTE (RE_Interrupt_ID);
+ end if;
+
+ if Expander_Active then
+ Temp := New_Copy_Tree (Parg2);
+ Set_Parent (Temp, N);
+ Preanalyze_And_Resolve (Temp, Typ);
+ else
+ Analyze (Parg2);
+ Resolve (Parg2, Typ);
+ end if;
+ end;
Process_Interrupt_Or_Attach_Handler;
end if;