Commit 94a98e80 by Ed Schonberg Committed by Pierre-Marie de Rodat

[Ada] Preserve Do_Range_Check flags in SPARK mode

2018-10-09  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* checks.adb (Apply_Type_Conversion_Checks): Use GNATprove_Mode
	rather than SPARK_mode in order to preserve the Do_Range_Check
	flag for verification purposes.

From-SVN: r264961
parent 0ffbef9f
2018-10-09 Ed Schonberg <schonberg@adacore.com> 2018-10-09 Ed Schonberg <schonberg@adacore.com>
* checks.adb (Apply_Type_Conversion_Checks): Use GNATprove_Mode
rather than SPARK_mode in order to preserve the Do_Range_Check
flag for verification purposes.
2018-10-09 Ed Schonberg <schonberg@adacore.com>
* exp_aggr.adb (Expand_Array_Aggregate): If it is not possible * exp_aggr.adb (Expand_Array_Aggregate): If it is not possible
to build in place an aggregate with component associations, set to build in place an aggregate with component associations, set
the Warnings_Off flag on the generated temporary, to prevent the Warnings_Off flag on the generated temporary, to prevent
......
...@@ -3555,9 +3555,8 @@ package body Checks is ...@@ -3555,9 +3555,8 @@ package body Checks is
-- in SPARK_Mode, where the explicit constraint check will -- in SPARK_Mode, where the explicit constraint check will
-- not be generated. -- not be generated.
if SPARK_Mode = On if GNATprove_Mode
or else (not Is_Fixed_Point_Type (Expr_Type) or else not Is_Fixed_Point_Type (Expr_Type)
and then not Is_Fixed_Point_Type (Target_Type))
then then
Apply_Scalar_Range_Check Apply_Scalar_Range_Check
(Expr, Target_Type, Fixed_Int => Conv_OK); (Expr, Target_Type, Fixed_Int => Conv_OK);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment