From: Piotr Trojanek Date: Tue, 9 Mar 2021 21:22:19 +0000 (+0100) Subject: [Ada] Fix detection of slices that denote the same object X-Git-Tag: basepoints/gcc-13~6727 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3447d9e49e33199b4c5c0fe16e272e3ecfd36275;p=thirdparty%2Fgcc.git [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 --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 6481d86a8358..c9d97a934643 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.