From 3447d9e49e33199b4c5c0fe16e272e3ecfd36275 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Tue, 9 Mar 2021 22:22:19 +0100 Subject: [PATCH] [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. --- 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 6481d86..c9d97a9 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. -- 2.7.4