From: Piotr Trojanek Date: Tue, 25 Nov 2025 10:29:28 +0000 (+0100) Subject: ada: Find overlying with slices X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=315965cf4e47118152e7e9bf7086ccf833cafa91;p=thirdparty%2Fgcc.git ada: Find overlying with slices A recent change removed rewriting of address of a slice into address of first component of a slice. Now we need to explicitly detect overlying with slices. Together, both changes cause warnings to be emitted when slice of a constant object is overlaid by a variable. gcc/ada/ChangeLog: * sem_util.adb (Find_Overlaid_Entity): Detect overlying with slice. --- diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 843bfb4a54b..ad7c0e647f0 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -9251,7 +9251,10 @@ package body Sem_Util is -- Check for components - elsif Nkind (Expr) in N_Selected_Component | N_Indexed_Component then + elsif Nkind (Expr) in N_Indexed_Component + | N_Selected_Component + | N_Slice + then Expr := Prefix (Expr); Off := True;