https://gcc.gnu.org/g:20513c99a2acf6b682dbdc5f015b9afa5368f004

commit r17-1692-g20513c99a2acf6b682dbdc5f015b9afa5368f004
Author: Eric Botcazou <[email protected]>
Date:   Thu Jun 4 18:32:09 2026 +0200

    ada: Fix minor inefficiency
    
    gcc/ada/ChangeLog:
    
            * sem_ch3.adb (Analyze_Object_Declaration): Streamline test.

Diff:
---
 gcc/ada/sem_ch3.adb | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 3cbef0c18194..e909e288b820 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -4661,9 +4661,7 @@ package body Sem_Ch3 is
       --  set the link in both the anonymous base type and anonymous subtype
       --  that are built to represent the array type to point to the object.
 
-      if Nkind (Object_Definition (Declaration_Node (Id))) =
-                        N_Constrained_Array_Definition
-      then
+      if Nkind (Object_Definition (N)) = N_Constrained_Array_Definition then
          Set_Related_Array_Object (T, Id);
          Set_Related_Array_Object (Base_Type (T), Id);
       end if;

Reply via email to