diff options
author | Arnaud Charlet <charlet@adacore.com> | 2018-05-30 08:56:54 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-05-30 08:56:54 +0000 |
commit | 88ad52c90d5aa992fbbcba44f91faccdc02150ef (patch) | |
tree | 3544e336a5da00b41c23294179f3959cb031291e /gcc/ada/sem_eval.adb | |
parent | 8ed508fe7fce89d1798a3cabf227d3e1c1d5cf85 (diff) | |
download | gcc-88ad52c90d5aa992fbbcba44f91faccdc02150ef.zip gcc-88ad52c90d5aa992fbbcba44f91faccdc02150ef.tar.gz gcc-88ad52c90d5aa992fbbcba44f91faccdc02150ef.tar.bz2 |
[Ada] Ignore out of range values for System.Priority in CodePeer mode
2018-05-30 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* checks.adb (Apply_Scalar_Range_Check):
* sem_eval.adb (Check_Non_Static_Context, Out_Of_Range): Ignore out of
range values for System.Priority in CodePeer mode since the actual
target compiler may provide a wider range.
From-SVN: r260929
Diffstat (limited to 'gcc/ada/sem_eval.adb')
-rw-r--r-- | gcc/ada/sem_eval.adb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index 48e141d..b216dab 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -574,8 +574,16 @@ package body Sem_Eval is null; elsif Is_Out_Of_Range (N, T, Assume_Valid => True) then - Apply_Compile_Time_Constraint_Error - (N, "value not in range of}<<", CE_Range_Check_Failed); + -- Ignore out of range values for System.Priority in CodePeer + -- mode since the actual target compiler may provide a wider + -- range. + + if CodePeer_Mode and then T = RTE (RE_Priority) then + Set_Do_Range_Check (N, False); + else + Apply_Compile_Time_Constraint_Error + (N, "value not in range of}<<", CE_Range_Check_Failed); + end if; elsif Checks_On then Enable_Range_Check (N); @@ -5437,9 +5445,11 @@ package body Sem_Eval is First_Rep_Item (Parent (N))); Rewrite (N, Make_Integer_Literal (Sloc (N), Uint_1)); - -- All cases except the special array case + -- All cases except the special array case. + -- No message if we are dealing with System.Priority values in + -- CodePeer mode where the target runtime may have more priorities. - else + elsif not CodePeer_Mode or else Etype (N) /= RTE (RE_Priority) then Apply_Compile_Time_Constraint_Error (N, "value not in range of}", CE_Range_Check_Failed); end if; |