aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-29 10:24:15 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-29 10:24:15 +0200
commit76af4137543b2654c2aeb91c4987590fff8546db (patch)
tree0f373ada6336a7b9ade4fefbcc59a03df31327c7 /gcc
parent9b20e59bb3e8d20d0f385a89c7fc815bff798c8a (diff)
downloadgcc-76af4137543b2654c2aeb91c4987590fff8546db.zip
gcc-76af4137543b2654c2aeb91c4987590fff8546db.tar.gz
gcc-76af4137543b2654c2aeb91c4987590fff8546db.tar.bz2
[multiple changes]
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog15
-rw-r--r--gcc/ada/exp_ch4.adb5
-rw-r--r--gcc/ada/sem_ch13.adb31
-rw-r--r--gcc/ada/sem_util.adb4
4 files changed, 39 insertions, 16 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 6261f1a..a2c0368 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 9ec558c..b2984b7 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -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;
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 3fa3a73..8d6bde5 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -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
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 6aaa3dc..5a07a4f 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -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));