From: Eric Botcazou Date: Sat, 18 Apr 2020 17:26:03 +0000 (+0200) Subject: [Ada] Small improvement to Optimize_Length_Comparison X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=52531a6203ca7a9d82b8e002a73b0b9d21b932c0;p=gcc.git [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. --- 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;