From 83851b239b0dd1af4fe3ba4c8d0ce7b74c82803d Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 11 Apr 2013 14:38:20 +0200 Subject: [multiple changes] 2013-04-11 Thomas Quinot * sem_util.adb (Set_Entity_With_Style_Check): Fix logic of check for implementation defined identifiers. 2013-04-11 Yannick Moy * checks.adb (Apply_Type_Conversion_Checks): Add an explanation of why range check and length are put on different nodes. * exp_ch4.adb (Apply_Type_Conversion_Checks): Remove check marks when doing their expansion. From-SVN: r197776 --- gcc/ada/exp_ch4.adb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gcc/ada/exp_ch4.adb') diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index be011f8..480151d 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -10053,6 +10053,19 @@ package body Exp_Ch4 is -- Start of processing for Expand_N_Type_Conversion begin + -- First remove check marks put by the semantic analysis on the type + -- conversion between array types. The front end expands these checks + -- explicitly, so they should not be set in the tree passed to the back + -- end. + + if Is_Array_Type (Target_Type) then + if Is_Constrained (Target_Type) then + Set_Do_Length_Check (N, False); + else + Set_Do_Range_Check (Operand, False); + end if; + end if; + -- Nothing at all to do if conversion is to the identical type so remove -- the conversion completely, it is useless, except that it may carry -- an Assignment_OK attribute, which must be propagated to the operand. -- cgit v1.1