OSDN Git Service

* exp_pakd.adb (Create_Packed_Array_Type): Always use a modular type
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Apr 2010 11:38:06 +0000 (11:38 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:17:21 +0000 (14:17 +0900)
if the size is small enough.  Propagate the alignment if there is an
alignment clause on the original array type.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Modular_Integer_Subtype>
Deal with under-aligned packed array types.  Copy the size onto the
justified modular type and don't lay it out again.  Likewise for the
padding type built for other under-aligned subtypes.
* gcc-interface/utils.c (finish_record_type): Do not set a default mode
on the type.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158056 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/testsuite/ChangeLog

index 09469ac..c740fa8 100644 (file)
@@ -1,5 +1,17 @@
 2010-04-07  Eric Botcazou  <ebotcazou@adacore.com>
 
+       * exp_pakd.adb (Create_Packed_Array_Type): Always use a modular type
+       if the size is small enough.  Propagate the alignment if there is an
+       alignment clause on the original array type.
+       * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Modular_Integer_Subtype>
+       Deal with under-aligned packed array types.  Copy the size onto the
+       justified modular type and don't lay it out again.  Likewise for the
+       padding type built for other under-aligned subtypes.
+       * gcc-interface/utils.c (finish_record_type): Do not set a default mode
+       on the type.
+
+2010-04-07  Eric Botcazou  <ebotcazou@adacore.com>
+
        * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Procedure>: Set default
        alignment on the RETURN type built for the Copy-In Copy-Out mechanism.
 
index 137d523..ad6c4a0 100644 (file)
@@ -1680,9 +1680,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
          /* Don't notify the field as "addressable", since we won't be taking
             it's address and it would prevent create_field_decl from making a
             bitfield.  */
-         gnu_field
-           = create_field_decl (get_identifier ("OBJECT"), gnu_field_type,
-                                gnu_type, NULL_TREE, bitsize_zero_node, 1, 0);
+         gnu_field = create_field_decl (get_identifier ("OBJECT"),
+                                        gnu_field_type, gnu_type, 1,
+                                        NULL_TREE, bitsize_zero_node, 0);
 
          /* Do not emit debug info until after the parallel type is added.  */
          finish_record_type (gnu_type, gnu_field, 2, false);
@@ -1731,9 +1731,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
          /* Don't notify the field as "addressable", since we won't be taking
             it's address and it would prevent create_field_decl from making a
             bitfield.  */
-         gnu_field
-           = create_field_decl (get_identifier ("F"), gnu_field_type,
-                                gnu_type, NULL_TREE, bitsize_zero_node, 1, 0);
+         gnu_field = create_field_decl (get_identifier ("F"),
+                                        gnu_field_type, gnu_type, 1,
+                                        NULL_TREE, bitsize_zero_node, 0);
 
          finish_record_type (gnu_type, gnu_field, 2, debug_info_p);
          compute_record_mode (gnu_type);
index e906105..fe68f14 100644 (file)
@@ -1,3 +1,9 @@
+2010-04-07  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/bit_packed_array.ad[sb]: Rename into...
+       * gnat.dg/bit_packed_array1.ad[sb]: ...this.
+       * gnat.dg/bit_packed_array4.ad[sb]: New test.
+
 2010-04-07  Jie Zhang  <jie@codesourcery.com>
 
        PR c++/42556