[COMMITTED,06/30] ada: Stop ignoring Component_Size attribute in CodePeer_Mode

Message ID 20240801151738.400796-6-poulhies@adacore.com
State Committed
Commit 53b215c0ca2792a0fd838be6e331d735bad409c7
Headers
Series [COMMITTED,01/30] ada: Remove obsolete workaround |

Commit Message

Marc Poulhiès Aug. 1, 2024, 3:17 p.m. UTC
  From: Ghjuvan Lacambre <lacambre@adacore.com>

This piece of code was introduced in 2011 in order to prevent spurious
false positives from appearing on specific code patterns making use of
Component_Size.
It seems that now this piece of code is causing small false positives
instead of preventing them, so let's remove it.

gcc/ada/

	* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Stop
	ignoring Component_Size attribute in CodePeer_Mode.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/sem_ch13.adb | 18 ------------------
 1 file changed, 18 deletions(-)
  

Patch

diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 957c43d689b..a7936641d34 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -6079,24 +6079,6 @@  package body Sem_Ch13 is
          Check_Restriction_No_Specification_Of_Aspect (N);
       end if;
 
-      --  Ignore some selected attributes in CodePeer mode since they are not
-      --  relevant in this context.
-
-      if CodePeer_Mode then
-         case Id is
-
-            --  Ignore Component_Size in CodePeer mode, to avoid changing the
-            --  internal representation of types by implicitly packing them.
-
-            when Attribute_Component_Size =>
-               Rewrite (N, Make_Null_Statement (Sloc (N)));
-               return;
-
-            when others =>
-               null;
-         end case;
-      end if;
-
       --  Process Ignore_Rep_Clauses option
 
       if Ignore_Rep_Clauses then