summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-29 09:41:15 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-29 09:41:15 +0000
commit20486e0be73a3de2b7afbf0e1309a928f166c893 (patch)
tree3ed508e1dcba52c10b6c5c6140f8d5e30e212298 /gcc
parentafc487704905873bb6cadaf0a652327160a1d1a0 (diff)
downloadgcc-20486e0be73a3de2b7afbf0e1309a928f166c893.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178182 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog21
-rw-r--r--gcc/ada/einfo.ads6
-rw-r--r--gcc/ada/exp_ch5.adb37
-rw-r--r--gcc/ada/exp_util.adb7
-rw-r--r--gcc/ada/s-pooglo.adb12
5 files changed, 72 insertions, 11 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index b63a9f351c5..24e400a154a 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,24 @@
+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.
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index 7ed878d3a2c..9e0ff33ddc6 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -1088,9 +1088,9 @@ package Einfo is
-- 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.
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 7dd2800d074..47ea0d84392 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -1890,10 +1890,41 @@ package body Exp_Ch5 is
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
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index a5faf484b26..64a6b6d3ffb 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -3028,6 +3028,11 @@ package body Exp_Util is
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
@@ -3328,8 +3333,6 @@ package body Exp_Util is
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 |
diff --git a/gcc/ada/s-pooglo.adb b/gcc/ada/s-pooglo.adb
index de96aa0f57d..6e9cc30a3c7 100644
--- a/gcc/ada/s-pooglo.adb
+++ b/gcc/ada/s-pooglo.adb
@@ -69,11 +69,15 @@ package body System.Pool_Global is
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);
@@ -105,7 +109,9 @@ package body System.Pool_Global is
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);