aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-02-02 12:42:10 -0800
committerIan Lance Taylor <iant@golang.org>2021-02-02 12:42:10 -0800
commit8910f1cd79445bbe2da01f8ccf7c37909349529e (patch)
treeba67a346969358fd7cc2b7c12384479de8364cab /gcc/ada/gcc-interface/utils.c
parent45c32be1f96ace25b66c34a84818dc5e07e9d516 (diff)
parent8e4a738d2540ab6aff77506d368bf4e3fa6963bd (diff)
downloadgcc-8910f1cd79445bbe2da01f8ccf7c37909349529e.zip
gcc-8910f1cd79445bbe2da01f8ccf7c37909349529e.tar.gz
gcc-8910f1cd79445bbe2da01f8ccf7c37909349529e.tar.bz2
Merge from trunk revision 8e4a738d2540ab6aff77506d368bf4e3fa6963bd.
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. */