aboutsummaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorJohn David Anglin <dave@hiauly1.hia.nrc.ca>2002-09-17 03:30:37 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2002-09-17 03:30:37 +0000
commit9dff28ab5386ec651699c6245823e3e2c68d1c64 (patch)
tree9562fab54c7f71944f468dd8ea88012248c2545e /gcc/calls.c
parent94313f351a9d53ae192d425c82b023b895827009 (diff)
downloadgcc-9dff28ab5386ec651699c6245823e3e2c68d1c64.zip
gcc-9dff28ab5386ec651699c6245823e3e2c68d1c64.tar.gz
gcc-9dff28ab5386ec651699c6245823e3e2c68d1c64.tar.bz2
calls.c (store_one_arg): Set default alignment for BLKmode arguments to BITS_PER_UNIT when...
* calls.c (store_one_arg): Set default alignment for BLKmode arguments to BITS_PER_UNIT when ARGS_GROW_DOWNWARD and the padding direction is downward. * function.c (pad_below): Always compile. (locate_and_pad_parm): If defined ARGS_GROW_DOWNWARD, pad argument to alignment when it is not in a register or REG_PARM_STACK_SPACE is true. Pad below when the argument is not in a register and the padding direction is downward. * pa-64.h (MUST_PASS_IN_STACK): Move define to pa.h. (PAD_VARARGS_DOWN): Define. * pa.c (function_arg_padding): Revise padding directions to make them compatible with the 32 and 64-bit runtime architecture documentation. (hppa_va_arg): Add code to handle variable and size zero arguments passed by reference on TARGET_64BIT. Reformat. (function_arg): Use a PARALLEL for BLKmode and aggregates args on TARGET_64BIT. Use a DImode PARALLEL for BLKmode args 5 to 8 bytes wide when !TARGET_64BIT. Move forward check for mode==VOIDmode. Add comments. * pa.h (MAX_PARM_BOUNDARY): Correct define for TARGET_64BIT. (RETURN_IN_MEMORY): Return size zero types in memory. (FUNCTION_VALUE): Return TFmode in general registers. (MUST_PASS_IN_STACK): Define. (FUNCTION_ARG_BOUNDARY): Simplify. (FUNCTION_ARG_PASS_BY_REFERENCE): Pass variable and zero sized types by reference. (FUNCTION_ARG_CALLEE_COPIES): Define to FUNCTION_ARG_PASS_BY_REFERENCE. From-SVN: r57226
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 665868f..578bd98 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -4491,6 +4491,7 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
{
/* BLKmode, at least partly to be pushed. */
+ unsigned int default_align = PARM_BOUNDARY;
int excess;
rtx size_rtx;
@@ -4498,6 +4499,13 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
If part is passed in registers, PARTIAL says how much
and emit_push_insn will take care of putting it there. */
+#ifdef ARGS_GROW_DOWNWARD
+ /* When an argument is padded down, the block is not aligned to
+ PARM_BOUNDARY. */
+ if (FUNCTION_ARG_PADDING (arg->mode, TREE_TYPE (pval)) == downward)
+ default_align = BITS_PER_UNIT;
+#endif
+
/* Round its size up to a multiple
of the allocation unit for arguments. */
@@ -4573,7 +4581,7 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
{
rtx size_rtx1 = GEN_INT (reg_parm_stack_space - arg->offset.constant);
emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), size_rtx1,
- MAX (PARM_BOUNDARY, TYPE_ALIGN (TREE_TYPE (pval))),
+ MAX (default_align, TYPE_ALIGN (TREE_TYPE (pval))),
partial, reg, excess, argblock,
ARGS_SIZE_RTX (arg->offset), reg_parm_stack_space,
ARGS_SIZE_RTX (arg->alignment_pad));
@@ -4582,7 +4590,7 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), size_rtx,
- MAX (PARM_BOUNDARY, TYPE_ALIGN (TREE_TYPE (pval))),
+ MAX (default_align, TYPE_ALIGN (TREE_TYPE (pval))),
partial, reg, excess, argblock,
ARGS_SIZE_RTX (arg->offset), reg_parm_stack_space,
ARGS_SIZE_RTX (arg->alignment_pad));