Commit 9b922d6a by Kito Cheng Committed by Jim Wilson

RISC-V: Make sure stack is always aligned during adjusting stack.

	gcc/
	2018-04-20  Kito Cheng  <kito.cheng@gmail.com>
	* config/riscv/riscv.c (riscv_first_stack_step): Round up min
	step to make sure stack always aligned.

From-SVN: r259530
parent b593a195
2018-04-20 Kito Cheng <kito.cheng@gmail.com>
* config/riscv/riscv.c (riscv_first_stack_step): Round up min
step to make sure stack always aligned.
2018-04-20 Carl Love <cel@us.ibm.com>
PR target/83402
......
......@@ -3507,7 +3507,8 @@ riscv_first_stack_step (struct riscv_frame_info *frame)
if (SMALL_OPERAND (frame->total_size))
return frame->total_size;
HOST_WIDE_INT min_first_step = frame->total_size - frame->fp_sp_offset;
HOST_WIDE_INT min_first_step =
RISCV_STACK_ALIGN (frame->total_size - frame->fp_sp_offset);
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment