[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 29 Aug 2011 08:24:15 +0000 (10:24 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 29 Aug 2011 08:24:15 +0000 (10:24 +0200)
2011-08-29  Eric Botcazou  <ebotcazou@adacore.com>

* sem_ch13.adb (Alignment_Check_For_Esize_Change): Rename to...
(Alignment_Check_For_Size_Change): ...this.  Add SIZE parameter and
use it instead of the Esize of the first parameter.
(Analyze_Attribute_Definition_Clause) <Object_Size>: Adjust call to
above change.
<Size>: Likewise.  Call it for composite types on the RM size.

2011-08-29  Yannick Moy  <moy@adacore.com>

* exp_ch4.adb (Expand_N_Op_Not): Do not expand not on array.
* sem_util.adb (Unique_Name): Correct behaviour for names of
compilation units.

From-SVN: r178157

gcc/ada/ChangeLog
gcc/ada/exp_ch4.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_util.adb

index 6261f1ac7edab184775b3f495c1d92891baf6469..a2c03681b6c651c0b5b1fad6f40f79503794adbf 100644 (file)
@@ -1,3 +1,18 @@
+2011-08-29  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * sem_ch13.adb (Alignment_Check_For_Esize_Change): Rename to...
+       (Alignment_Check_For_Size_Change): ...this.  Add SIZE parameter and
+       use it instead of the Esize of the first parameter.
+       (Analyze_Attribute_Definition_Clause) <Object_Size>: Adjust call to
+       above change.
+       <Size>: Likewise.  Call it for composite types on the RM size.
+
+2011-08-29  Yannick Moy  <moy@adacore.com>
+
+       * exp_ch4.adb (Expand_N_Op_Not): Do not expand not on array.
+       * sem_util.adb (Unique_Name): Correct behaviour for names of
+       compilation units.
+
 2011-08-29  Yannick Moy  <moy@adacore.com>
 
        * sem_prag.adb (Check_Precondition_Postcondition): In formal
index 9ec558cca2ae2992140637998e1e148597157f02..b2984b791d1e14128e4352d5e189ec9f03936d58 100644 (file)
@@ -7158,9 +7158,10 @@ package body Exp_Ch4 is
          end;
       end if;
 
-      --  Only array types need any other processing
+      --  Only array types need any other processing. In formal verification
+      --  mode, no other processing is done.
 
-      if not Is_Array_Type (Typ) then
+      if not Is_Array_Type (Typ) or else ALFA_Mode then
          return;
       end if;
 
index 3fa3a737306fff19356a16980cda84a2fe380b5d..8d6bde537e72eb17dfaeebe983a1af6772b1aa60 100644 (file)
@@ -73,11 +73,11 @@ package body Sem_Ch13 is
    -- Local Subprograms --
    -----------------------
 
-   procedure Alignment_Check_For_Esize_Change (Typ : Entity_Id);
-   --  This routine is called after setting the Esize of type entity Typ.
-   --  The purpose is to deal with the situation where an alignment has been
-   --  inherited from a derived type that is no longer appropriate for the
-   --  new Esize value. In this case, we reset the Alignment to unknown.
+   procedure Alignment_Check_For_Size_Change (Typ : Entity_Id; Size : Uint);
+   --  This routine is called after setting one of the sizes of type entity
+   --  Typ to Size. The purpose is to deal with the situation of a derived
+   --  type whose inherited alignment is no longer appropriate for the new
+   --  size value. In this case, we reset the Alignment to unknown.
 
    procedure Build_Predicate_Function (Typ : Entity_Id; N : Node_Id);
    --  If Typ has predicates (indicated by Has_Predicates being set for Typ,
@@ -661,11 +661,11 @@ package body Sem_Ch13 is
       end if;
    end Adjust_Record_For_Reverse_Bit_Order;
 
-   --------------------------------------
-   -- Alignment_Check_For_Esize_Change --
-   --------------------------------------
+   -------------------------------------
+   -- Alignment_Check_For_Size_Change --
+   -------------------------------------
 
-   procedure Alignment_Check_For_Esize_Change (Typ : Entity_Id) is
+   procedure Alignment_Check_For_Size_Change (Typ : Entity_Id; Size : Uint) is
    begin
       --  If the alignment is known, and not set by a rep clause, and is
       --  inconsistent with the size being set, then reset it to unknown,
@@ -674,11 +674,11 @@ package body Sem_Ch13 is
 
       if Known_Alignment (Typ)
         and then not Has_Alignment_Clause (Typ)
-        and then Esize (Typ) mod (Alignment (Typ) * SSU) /= 0
+        and then Size mod (Alignment (Typ) * SSU) /= 0
       then
          Init_Alignment (Typ);
       end if;
-   end Alignment_Check_For_Esize_Change;
+   end Alignment_Check_For_Size_Change;
 
    -----------------------------------
    -- Analyze_Aspect_Specifications --
@@ -2510,7 +2510,7 @@ package body Sem_Ch13 is
 
                Set_Esize (U_Ent, Size);
                Set_Has_Object_Size_Clause (U_Ent);
-               Alignment_Check_For_Esize_Change (U_Ent);
+               Alignment_Check_For_Size_Change (U_Ent, Size);
             end if;
          end Object_Size;
 
@@ -2603,6 +2603,9 @@ package body Sem_Ch13 is
                   --  (object size) unset, the back end will set it from the
                   --  size and alignment in an appropriate manner.
 
+                  --  In both cases, we check whether the alignment must be
+                  --  reset in the wake of the size change.
+
                   if Is_Elementary_Type (U_Ent) then
                      if Size <= System_Storage_Unit then
                         Init_Esize (U_Ent, System_Storage_Unit);
@@ -2614,7 +2617,9 @@ package body Sem_Ch13 is
                         Set_Esize  (U_Ent, (Size + 63) / 64 * 64);
                      end if;
 
-                     Alignment_Check_For_Esize_Change (U_Ent);
+                     Alignment_Check_For_Size_Change (U_Ent, Esize (U_Ent));
+                  else
+                     Alignment_Check_For_Size_Change (U_Ent, Size);
                   end if;
 
                --  For objects, set Esize only
index 6aaa3dceba62614866e24afb04dc784c543858c3..5a07a4f77b6066c90643dbccf6ef4058729498ca 100644 (file)
@@ -12384,7 +12384,9 @@ package body Sem_Util is
       if E = Standard_Standard then
          return Get_Name_String (Name_Standard);
 
-      elsif Scope (E) = Standard_Standard then
+      elsif Scope (E) = Standard_Standard
+        and then not (Ekind (E) = E_Package or else Is_Subprogram (E))
+      then
          return Get_Name_String (Name_Standard) & "__" &
            Get_Name_String (Chars (E));