aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2020-04-10 11:20:55 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-06-17 04:13:59 -0400
commite9c85394fb16fd43a05cd9ee5dbca3e96cc68dfb (patch)
treed46c7c59f3311a7977ed215a37bd1769e495a9ef /gcc
parent6be763897bcabab90eeae0dfda963531802a4ae9 (diff)
downloadgcc-e9c85394fb16fd43a05cd9ee5dbca3e96cc68dfb.zip
gcc-e9c85394fb16fd43a05cd9ee5dbca3e96cc68dfb.tar.gz
gcc-e9c85394fb16fd43a05cd9ee5dbca3e96cc68dfb.tar.bz2
[Ada] Fix small fallout of change for 'Pos and 'Val attributes
2020-06-17 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_fixd.adb (Build_Conversion): Also preserve the Conversion_OK flag of an inner conversion.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/exp_fixd.adb4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/ada/exp_fixd.adb b/gcc/ada/exp_fixd.adb
index 621ec7a..d956278 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