aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2021-01-08 21:43:10 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2021-05-06 03:51:31 -0400
commit0632f8686633a436f05425f01276f35aa29438c1 (patch)
tree3758c8f85663ad00b2ffea0c39f484b7725d34fa
parent55b93bbc2158203b776bf516cba0117208e2f649 (diff)
downloadgcc-0632f8686633a436f05425f01276f35aa29438c1.zip
gcc-0632f8686633a436f05425f01276f35aa29438c1.tar.gz
gcc-0632f8686633a436f05425f01276f35aa29438c1.tar.bz2
[Ada] Set Raises_CE flag only in Apply_Compile_Time_Constraint_Error
gcc/ada/ * sem_ch4.adb (Analyze_Selected_Component): Remove explicit call to Set_Raises_Constraint_Error on statically missing component. * sem_eval.adb (Eval_Arithmetic_Op): Likewise for static divisions by integer and real zeros. * sem_util.adb (Apply_Compile_Time_Constraint_Error): Call Set_Raises_Constraint_Error before exiting early in GNATprove mode.
-rw-r--r--gcc/ada/sem_ch4.adb2
-rw-r--r--gcc/ada/sem_eval.adb2
-rw-r--r--gcc/ada/sem_util.adb1
3 files changed, 1 insertions, 4 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 59ce28e..15b4999 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -5452,8 +5452,6 @@ package body Sem_Ch4 is
(N, "component not present in }??",
CE_Discriminant_Check_Failed,
Ent => Prefix_Type);
-
- Set_Raises_Constraint_Error (N);
return;
end if;
diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb
index a1e32f9..9b272d2 100644
--- a/gcc/ada/sem_eval.adb
+++ b/gcc/ada/sem_eval.adb
@@ -2124,7 +2124,6 @@ package body Sem_Eval is
Apply_Compile_Time_Constraint_Error
(N, "division by zero", CE_Divide_By_Zero,
Warn => not Stat or SPARK_Mode = On);
- Set_Raises_Constraint_Error (N);
return;
-- Otherwise we can do the division
@@ -2226,7 +2225,6 @@ package body Sem_Eval is
if UR_Is_Zero (Right_Real) then
Apply_Compile_Time_Constraint_Error
(N, "division by zero", CE_Divide_By_Zero);
- Set_Raises_Constraint_Error (N);
return;
end if;
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 86dd95b..551ad9f 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -1436,6 +1436,7 @@ package body Sem_Util is
-- generate a check message.
if GNATprove_Mode then
+ Set_Raises_Constraint_Error (N);
return;
end if;