public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-1586] [Ada] Fix detection of slices that denote the same object
Date: Thu, 17 Jun 2021 14:34:20 +0000 (GMT)	[thread overview]
Message-ID: <20210617143420.9547439574CD@sourceware.org> (raw)

https://gcc.gnu.org/g:3447d9e49e33199b4c5c0fe16e272e3ecfd36275

commit r12-1586-g3447d9e49e33199b4c5c0fe16e272e3ecfd36275
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Tue Mar 9 22:22:19 2021 +0100

    [Ada] Fix detection of slices that denote the same object
    
    gcc/ada/
    
            * sem_util.adb (Denotes_Same_Object): Call Get_Index_Bounds with
            the range of a slice object, not its type.

Diff:
---
 gcc/ada/sem_util.adb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 6481d86a835..c9d97a93464 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -7482,8 +7482,8 @@ package body Sem_Util is
             Lo1, Lo2, Hi1, Hi2 : Node_Id;
 
          begin
-            Get_Index_Bounds (Etype (Obj1), Lo1, Hi1);
-            Get_Index_Bounds (Etype (Obj2), Lo2, Hi2);
+            Get_Index_Bounds (Discrete_Range (Obj1), Lo1, Hi1);
+            Get_Index_Bounds (Discrete_Range (Obj2), Lo2, Hi2);
 
             --  Check whether bounds are statically identical. There is no
             --  attempt to detect partial overlap of slices.


                 reply	other threads:[~2021-06-17 14:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210617143420.9547439574CD@sourceware.org \
    --to=pmderodat@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).