aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 494f60e..c503bfb 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -1571,7 +1571,7 @@ maybe_pad_type (tree type, tree size, unsigned int align,
{
tree packable_type = make_packable_type (type, true, align);
if (TYPE_MODE (packable_type) != BLKmode
- && align >= TYPE_ALIGN (packable_type))
+ && compare_tree_int (TYPE_SIZE (packable_type), align) <= 0)
type = packable_type;
}
@@ -3521,6 +3521,12 @@ create_subprog_decl (tree name, tree asm_name, tree type, tree param_decl_list,
void
finish_subprog_decl (tree decl, tree asm_name, tree type)
{
+ /* DECL_ARGUMENTS is set by the caller, but not its context. */
+ for (tree param_decl = DECL_ARGUMENTS (decl);
+ param_decl;
+ param_decl = DECL_CHAIN (param_decl))
+ DECL_CONTEXT (param_decl) = decl;
+
tree result_decl
= build_decl (DECL_SOURCE_LOCATION (decl), RESULT_DECL, NULL_TREE,
TREE_TYPE (type));
@@ -3566,8 +3572,6 @@ finish_subprog_decl (tree decl, tree asm_name, tree type)
void
begin_subprog_body (tree subprog_decl)
{
- tree param_decl;
-
announce_function (subprog_decl);
/* This function is being defined. */
@@ -3583,10 +3587,6 @@ begin_subprog_body (tree subprog_decl)
/* Enter a new binding level and show that all the parameters belong to
this function. */
gnat_pushlevel ();
-
- for (param_decl = DECL_ARGUMENTS (subprog_decl); param_decl;
- param_decl = DECL_CHAIN (param_decl))
- DECL_CONTEXT (param_decl) = subprog_decl;
}
/* Finish translating the current subprogram and set its BODY. */