decl.c (gnat_to_gnu_entity): Set minimum alignment on fields of the RETURN type built...
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 8 Apr 2011 20:30:14 +0000 (20:30 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 8 Apr 2011 20:30:14 +0000 (20:30 +0000)
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Procedure>: Set minimum
alignment on fields of the RETURN type built for the Copy-In Copy-Out
mechanism.

From-SVN: r172210

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

index 2046aa715d98ecd6b38eef51fbb9a951eba5eccb..e16092ff33eb2898cdccf8b8eb61b812a4f5892d 100644 (file)
@@ -1,3 +1,9 @@
+2011-04-08  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Procedure>: Set minimum
+       alignment on fields of the RETURN type built for the Copy-In Copy-Out
+       mechanism.
+
 2011-04-08  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc-interface/trans.c (Identifier_to_gnu): Do not return initializers
index 29023965fc5c28f5a513103d6fb2ff2541b58b69..bc6b9cc7bf3457f866732afc31250fa04646e651 100644 (file)
@@ -4226,6 +4226,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
                  = create_field_decl (gnu_param_name, gnu_param_type,
                                       gnu_return_type, NULL_TREE, NULL_TREE,
                                       0, 0);
+               /* Set a minimum alignment to speed up accesses.  */
+               if (DECL_ALIGN (gnu_field) < TYPE_ALIGN (gnu_return_type))
+                 DECL_ALIGN (gnu_field) = TYPE_ALIGN (gnu_return_type);
                Sloc_to_locus (Sloc (gnat_param),
                               &DECL_SOURCE_LOCATION (gnu_field));
                DECL_CHAIN (gnu_field) = gnu_field_list;