public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/autopar_devel] [Ada] Small improvement to Optimize_Length_Comparison
@ 2020-08-22 22:46 Giuliano Belinassi
  0 siblings, 0 replies; only message in thread
From: Giuliano Belinassi @ 2020-08-22 22:46 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:8815d9643225804ca044f361fa8b8a5185608de4

commit 8815d9643225804ca044f361fa8b8a5185608de4
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Sat Apr 18 19:26:03 2020 +0200

    [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.

Diff:
---
 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;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-22 22:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-22 22:46 [gcc/devel/autopar_devel] [Ada] Small improvement to Optimize_Length_Comparison Giuliano Belinassi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).