From 10853d6e8a0cc92f2dcf2a396db9ae73f75b5abc Mon Sep 17 00:00:00 2001
From: Piotr Trojanek <trojanek@adacore.com>
Date: Mon, 23 Nov 2020 23:44:06 +0100
Subject: [PATCH] [Ada] Refactor repeated code for component attributes

gcc/ada/

	* sem_attr.adb (Analyze_Attribute): Merge identical code for
	First_Bit/Last_Bit and Position attributes.
---
 gcc/ada/sem_attr.adb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 30fdfb8c55d6..537da93dc662 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -4094,6 +4094,7 @@ package body Sem_Attr is
 
       when Attribute_First_Bit
          | Attribute_Last_Bit
+         | Attribute_Position
       =>
          Check_Component;
          Set_Etype (N, Universal_Integer);
@@ -5305,9 +5306,7 @@ package body Sem_Attr is
       -- Position --
       --------------
 
-      when Attribute_Position =>
-         Check_Component;
-         Set_Etype (N, Universal_Integer);
+      --  Shares processing with First_Bit attribute
 
       ----------
       -- Pred --
-- 
GitLab