From e9c85394fb16fd43a05cd9ee5dbca3e96cc68dfb Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 10 Apr 2020 11:20:55 +0200 Subject: [PATCH] [Ada] Fix small fallout of change for 'Pos and 'Val attributes 2020-06-17 Eric Botcazou gcc/ada/ * exp_fixd.adb (Build_Conversion): Also preserve the Conversion_OK flag of an inner conversion. --- gcc/ada/exp_fixd.adb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/ada/exp_fixd.adb b/gcc/ada/exp_fixd.adb index 621ec7addbf..d956278c87f 100644 --- a/gcc/ada/exp_fixd.adb +++ b/gcc/ada/exp_fixd.adb @@ -262,7 +262,8 @@ package body Exp_Fixd is -- Remove inner conversion if both inner and outer conversions are -- to integer types, since the inner one serves no purpose (except -- perhaps to set rounding, so we preserve the Rounded_Result flag) - -- and also we preserve the range check flag on the inner operand + -- and also preserve the Conversion_OK and Do_Range_Check flags of + -- the inner conversion. if Is_Integer_Type (Typ) and then Is_Integer_Type (Etype (Expr)) @@ -273,6 +274,7 @@ package body Exp_Fixd is Subtype_Mark => New_Occurrence_Of (Typ, Loc), Expression => Expression (Expr)); Set_Rounded_Result (Result, Rounded_Result_Set (Expr)); + Set_Conversion_OK (Result, Conversion_OK (Expr)); Rcheck := Rcheck or Do_Range_Check (Expr); -- For all other cases, a simple type conversion will work -- 2.30.2