diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2020-04-18 19:26:03 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-06-18 05:08:12 -0400 |
commit | 52531a6203ca7a9d82b8e002a73b0b9d21b932c0 (patch) | |
tree | 3e768b37002b5de8266f8bde8513eba37480d3ab | |
parent | d11c9841d54ed74978f8d0e0f352631f90504dd5 (diff) | |
download | gcc-52531a6203ca7a9d82b8e002a73b0b9d21b932c0.zip gcc-52531a6203ca7a9d82b8e002a73b0b9d21b932c0.tar.gz gcc-52531a6203ca7a9d82b8e002a73b0b9d21b932c0.tar.bz2 |
[Ada] Small improvement to Optimize_Length_Comparison
2020-06-18 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* exp_ch4.adb (Optimize_Length_Comparison): Accept 32-bit values
in the full unsigned range.
-rw-r--r-- | gcc/ada/exp_ch4.adb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index e7db7b0..c4cd9b5 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; |