summaryrefslogtreecommitdiff
path: root/gcc/config/nios2/nios2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/nios2/nios2.c')
-rw-r--r--gcc/config/nios2/nios2.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/config/nios2/nios2.c b/gcc/config/nios2/nios2.c
index fa7f14e0f55..893ddd19e59 100644
--- a/gcc/config/nios2/nios2.c
+++ b/gcc/config/nios2/nios2.c
@@ -2983,30 +2983,31 @@ nios2_function_arg_advance (cumulative_args_t cum_v, machine_mode mode,
cum->regs_used += param_size;
}
-enum direction
+static pad_direction
nios2_function_arg_padding (machine_mode mode, const_tree type)
{
/* On little-endian targets, the first byte of every stack argument
is passed in the first byte of the stack slot. */
if (!BYTES_BIG_ENDIAN)
- return upward;
+ return PAD_UPWARD;
/* Otherwise, integral types are padded downward: the last byte of a
stack argument is passed in the last byte of the stack slot. */
if (type != 0
? INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type)
: GET_MODE_CLASS (mode) == MODE_INT)
- return downward;
+ return PAD_DOWNWARD;
/* Arguments smaller than a stack slot are padded downward. */
if (mode != BLKmode)
- return (GET_MODE_BITSIZE (mode) >= PARM_BOUNDARY) ? upward : downward;
+ return (GET_MODE_BITSIZE (mode) >= PARM_BOUNDARY
+ ? PAD_UPWARD : PAD_DOWNWARD);
return ((int_size_in_bytes (type) >= (PARM_BOUNDARY / BITS_PER_UNIT))
- ? upward : downward);
+ ? PAD_UPWARD : PAD_DOWNWARD);
}
-enum direction
+pad_direction
nios2_block_reg_padding (machine_mode mode, tree type,
int first ATTRIBUTE_UNUSED)
{
@@ -5009,6 +5010,9 @@ nios2_adjust_reg_alloc_order (void)
#undef TARGET_FUNCTION_ARG_ADVANCE
#define TARGET_FUNCTION_ARG_ADVANCE nios2_function_arg_advance
+#undef TARGET_FUNCTION_ARG_PADDING
+#define TARGET_FUNCTION_ARG_PADDING nios2_function_arg_padding
+
#undef TARGET_ARG_PARTIAL_BYTES
#define TARGET_ARG_PARTIAL_BYTES nios2_arg_partial_bytes