]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl.c (gnat_to_gnu_entity): Do not strip the padding type if the parameter is not...
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 7 Jul 2005 09:41:56 +0000 (11:41 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 7 Jul 2005 09:41:56 +0000 (11:41 +0200)
2005-07-07  Eric Botcazou  <ebotcazou@adacore.com>

* decl.c (gnat_to_gnu_entity) <E_Procedure>: Do not strip the padding
type if the parameter is not passed by copy but reference by default.

From-SVN: r101693

gcc/ada/decl.c

index fb6d002da074ee102a4611ff3a6b176274523aa6..88fef2157d397e8fd1fd2f83619bc3422ae1c629 100644 (file)
@@ -3426,8 +3426,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
            if (TREE_CODE (gnu_param_type) == RECORD_TYPE
                && TYPE_IS_PADDING_P (gnu_param_type)
                && (req_by_ref || Has_Foreign_Convention (gnat_entity)
-                   || !must_pass_by_ref (TREE_TYPE (TYPE_FIELDS
-                                                    (gnu_param_type)))))
+                   || (!must_pass_by_ref (TREE_TYPE (TYPE_FIELDS
+                                                     (gnu_param_type)))
+                       && (req_by_copy
+                           || !default_pass_by_ref (TREE_TYPE
+                                                     (TYPE_FIELDS
+                                                      (gnu_param_type)))))))
              gnu_param_type = TREE_TYPE (TYPE_FIELDS (gnu_param_type));
 
            /* If this is an IN parameter it is read-only, so make a variant