From: Jim Wilson Date: Mon, 19 Mar 2018 18:08:24 +0000 (+0000) Subject: RISC-V: Fix bootstrap failure. X-Git-Tag: upstream/12.2.0~32798 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c0d3d1b681f7847299b2e8e14c61cf903d6ee8fd;p=platform%2Fupstream%2Fgcc.git RISC-V: Fix bootstrap failure. gcc/ 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. From-SVN: r258650 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bc64367..bed98d6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2018-03-19 Jim Wilson + + 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 PR tree-optimization/84933 diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c index 3e81874..9e1005e 100644 --- a/gcc/config/riscv/riscv.c +++ b/gcc/config/riscv/riscv.c @@ -2202,7 +2202,7 @@ riscv_expand_conditional_branch (rtx label, rtx_code code, rtx op0, rtx op1) /* 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) @@ -2215,7 +2215,7 @@ 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 @@ -3506,7 +3506,7 @@ riscv_first_stack_step (struct riscv_frame_info *frame) 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); @@ -4142,7 +4142,7 @@ riscv_option_override (void) 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)) diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h index 6144e26..ebd80c0 100644 --- a/gcc/config/riscv/riscv.h +++ b/gcc/config/riscv/riscv.h @@ -124,13 +124,13 @@ along with GCC; see the file COPYING3. If not see #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. */ @@ -482,7 +482,7 @@ enum reg_class `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. */ @@ -540,7 +540,7 @@ typedef struct { /* 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