+2018-03-19 Jim Wilson <jimw@sifive.com>
+
+ PR bootstrap/84856
+ * config/riscv/riscv.c (riscv_function_arg_boundary): Use
+ PREFERRED_STACK_BOUNDARY instead of STACK_BOUNDARY.
+ (riscv_first_stack_step): Likewise.
+ (riscv_option_override): Use STACK_BOUNDARY instead of
+ MIN_STACK_BOUNDARY.
+ * config/riscv/riscv.h (STACK_BOUNDARY): Renamed from
+ MIN_STACK_BOUNDARY.
+ (BIGGEST_ALIGNMENT): Set to 128.
+ (PREFERRED_STACK_BOUNDARY): Renamed from STACK_BOUNDARY.
+ (RISCV_STACK_ALIGN): Use PREFERRED_STACK_BOUNDARY instead of
+ STACK_BOUNDARY.
+
2018-03-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/84933
/* Implement TARGET_FUNCTION_ARG_BOUNDARY. Every parameter gets at
least PARM_BOUNDARY bits of alignment, but will be given anything up
- to STACK_BOUNDARY bits if the type requires it. */
+ to PREFERRED_STACK_BOUNDARY bits if the type requires it. */
static unsigned int
riscv_function_arg_boundary (machine_mode mode, const_tree type)
else
alignment = type ? TYPE_ALIGN (type) : GET_MODE_ALIGNMENT (mode);
- return MIN (STACK_BOUNDARY, MAX (PARM_BOUNDARY, alignment));
+ return MIN (PREFERRED_STACK_BOUNDARY, MAX (PARM_BOUNDARY, alignment));
}
/* If MODE represents an argument that can be passed or returned in
return frame->total_size;
HOST_WIDE_INT min_first_step = frame->total_size - frame->fp_sp_offset;
- HOST_WIDE_INT max_first_step = IMM_REACH / 2 - STACK_BOUNDARY / 8;
+ HOST_WIDE_INT max_first_step = IMM_REACH / 2 - PREFERRED_STACK_BOUNDARY / 8;
HOST_WIDE_INT min_second_step = frame->total_size - max_first_step;
gcc_assert (min_first_step <= max_first_step);
riscv_stack_boundary = ABI_STACK_BOUNDARY;
if (riscv_preferred_stack_boundary_arg)
{
- int min = ctz_hwi (MIN_STACK_BOUNDARY / 8);
+ int min = ctz_hwi (STACK_BOUNDARY / 8);
int max = 8;
if (!IN_RANGE (riscv_preferred_stack_boundary_arg, min, max))
#define FUNCTION_BOUNDARY (TARGET_RVC ? 16 : 32)
/* The smallest supported stack boundary the calling convention supports. */
-#define MIN_STACK_BOUNDARY (2 * BITS_PER_WORD)
+#define STACK_BOUNDARY (2 * BITS_PER_WORD)
/* The ABI stack alignment. */
#define ABI_STACK_BOUNDARY 128
/* There is no point aligning anything to a rounder boundary than this. */
-#define BIGGEST_ALIGNMENT STACK_BOUNDARY
+#define BIGGEST_ALIGNMENT 128
/* The user-level ISA permits unaligned accesses, but they are not required
of the privileged architecture. */
`crtl->outgoing_args_size'. */
#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
-#define STACK_BOUNDARY riscv_stack_boundary
+#define PREFERRED_STACK_BOUNDARY riscv_stack_boundary
/* Symbolic macros for the registers used to return integer and floating
point values. */
/* Align based on stack boundary, which might have been set by the user. */
#define RISCV_STACK_ALIGN(LOC) \
- (((LOC) + ((STACK_BOUNDARY/8)-1)) & -(STACK_BOUNDARY/8))
+ (((LOC) + ((PREFERRED_STACK_BOUNDARY/8)-1)) & -(PREFERRED_STACK_BOUNDARY/8))
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
the stack pointer does not matter. The value is tested only in