+2011-08-29 Thomas Quinot <quinot@adacore.com>
+
+ * s-pooglo.adb: Minor reformatting.
+
+2011-08-29 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch5.adb (Expand_N_Assignment_Statement): if the left-hand side is
+ an indexed component of a packed array whose element type is a record
+ with a representation clause different from that of the right-hand
+ side, generate a temporary to minimuze the number of bit-field
+ operations generated.
+
+2011-08-29 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_util.adb (Insert_Actions): Use clauses can be part of lists of
+ declarations, and thus are likely insertion points for actions.
+
+2011-08-29 Bob Duff <duff@adacore.com>
+
+ * einfo.ads: Minor comment fix.
+
2011-08-29 Robert Dewar <dewar@adacore.com>
* frontend.adb, gnat1drv.adb: Minor reformatting.
-- is itself another entity. For a type entity, points to the parent
-- type for a derived type, or if the type is not derived, points to
-- itself. For a subtype entity, Etype points to the base type. For
--- a class wide type, points to the parent type. For a subprogram or
--- subprogram type, Etype has the return type of a function or is set
--- to Standard_Void_Type to represent a procedure.
+-- a class wide type, points to the corresponding specific type. For a
+-- subprogram or subprogram type, Etype has the return type of a function
+-- or is set to Standard_Void_Type to represent a procedure.
--
-- Note one obscure case: for pragma Default_Storage_Pool (null), the
-- Etype of the N_Null node is Empty.
if Nkind (Lhs) = N_Indexed_Component
and then Is_Bit_Packed_Array (Etype (Prefix (Lhs)))
- and then not Crep
then
- Expand_Bit_Packed_Element_Set (N);
- return;
+ if not Crep then
+ Expand_Bit_Packed_Element_Set (N);
+ return;
+ else
+
+ -- Generate the following, to force component-by-component
+ -- assignments in an efficient way. Otherwise each component
+ -- will require a temporary and two bit-field manipulations.
+
+ -- T1 : Elmt_Type;
+ -- T1 := RhS;
+ -- Lhs := T1;
+
+ declare
+ Tnn : constant Entity_Id := Make_Temporary (Loc, 'T');
+ Stats : List_Id;
+
+ begin
+ Stats := New_List (
+ Make_Object_Declaration (Loc,
+ Defining_Identifier => Tnn,
+ Object_Definition => New_Occurrence_Of (Etype (Lhs), Loc)),
+ Make_Assignment_Statement (Loc,
+ Name => New_Occurrence_Of (Tnn, Loc),
+ Expression => Relocate_Node (Rhs)),
+ Make_Assignment_Statement (Loc,
+ Name => Relocate_Node (Lhs),
+ Expression => New_Occurrence_Of (Tnn, Loc)));
+
+ Insert_Actions (N, Stats);
+ Rewrite (N, Make_Null_Statement (Loc));
+ Analyze (N);
+ end;
+ end if;
-- Build-in-place function call case. Note that we're not yet doing
-- build-in-place for user-written assignment statements (the assignment
N_Task_Body_Stub |
N_Task_Type_Declaration |
+ -- Use clauses can appear in lists of declarations
+
+ N_Use_Package_Clause |
+ N_Use_Type_Clause |
+
-- Freeze entity behaves like a declaration or statement
N_Freeze_Entity
N_Unconstrained_Array_Definition |
N_Unused_At_End |
N_Unused_At_Start |
- N_Use_Package_Clause |
- N_Use_Type_Clause |
N_Variant |
N_Variant_Part |
N_Validate_Unchecked_Conversion |
end if;
if Alignment > Standard'System_Allocator_Alignment then
- -- Realign the returned address.
+
+ -- Realign the returned address
+
Aligned_Address := To_Address
(To_Integer (Allocated) + Integer_Address (Alignment)
- (To_Integer (Allocated) mod Integer_Address (Alignment)));
- -- Save the block address.
+
+ -- Save the block address
+
declare
Saved_Address : System.Address;
pragma Import (Ada, Saved_Address);
begin
if Alignment > Standard'System_Allocator_Alignment then
- -- Retrieve the block address.
+
+ -- Retrieve the block address
+
declare
Saved_Address : System.Address;
pragma Import (Ada, Saved_Address);