From: Piotr Trojanek <troja...@adacore.com>

Recent change for attribute Object_Size caused spurious errors when
restriction No_Implementation_Attributes is active and attribute
Object_Size is introduced by expansion of dispatching operations.

Temporarily revert that change for a further investigation.

gcc/ada/

        * sem_attr.adb (Attribute_22): Remove Put_Image and Object_Size.
        * sem_attr.ads (Attribute_Imp_Def): Restore Object_Size.

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

---
 gcc/ada/sem_attr.adb |  4 +---
 gcc/ada/sem_attr.ads | 11 +++++++++++
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index b979ffdf0b1..65442d45a85 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -181,9 +181,7 @@ package body Sem_Attr is
      (Attribute_Enum_Rep                     |
       Attribute_Enum_Val                     |
       Attribute_Index                        |
-      Attribute_Object_Size                  |
-      Attribute_Preelaborable_Initialization |
-      Attribute_Put_Image                    => True,
+      Attribute_Preelaborable_Initialization => True,
       others                                 => False);
 
    --  The following array contains all attributes that imply a modification
diff --git a/gcc/ada/sem_attr.ads b/gcc/ada/sem_attr.ads
index 65b7b534711..4c9f27043c6 100644
--- a/gcc/ada/sem_attr.ads
+++ b/gcc/ada/sem_attr.ads
@@ -373,6 +373,17 @@ package Sem_Attr is
       --  other composite object passed by reference, there is no other way
       --  of specifying that a zero address should be passed.
 
+      -----------------
+      -- Object_Size --
+      -----------------
+
+      Attribute_Object_Size => True,
+      --  Type'Object_Size is the same as Type'Size for all types except
+      --  fixed-point types and discrete types. For fixed-point types and
+      --  discrete types, this attribute gives the size used for default
+      --  allocation of objects and components of the size. See section in
+      --  Einfo ("Handling of Type'Size values") for further details.
+
       -------------------------
       -- Passed_By_Reference --
       -------------------------
-- 
2.43.2

Reply via email to