From 52531a6203ca7a9d82b8e002a73b0b9d21b932c0 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Sat, 18 Apr 2020 19:26:03 +0200 Subject: [PATCH] [Ada] Small improvement to Optimize_Length_Comparison 2020-06-18 Eric Botcazou gcc/ada/ * exp_ch4.adb (Optimize_Length_Comparison): Accept 32-bit values in the full unsigned range. --- gcc/ada/exp_ch4.adb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index e7db7b0150f..c4cd9b59f7b 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -13898,13 +13898,14 @@ package body Exp_Ch4 is end if; end if; - -- Here we have to make sure of being within 32-bits + -- Here we have to make sure of being within a 32-bit range (take the + -- full unsigned range so the length of 32-bit arrays is accepted). Determine_Range (N, OK, Lo, Hi, Assume_Valid => True); if not OK or else Lo < Uint_0 - or else Hi > UI_From_Int (Int'Last) + or else Hi > Uint_2 ** 32 then return False; end if; -- 2.30.2