From: Kito Cheng Date: Fri, 20 Apr 2018 19:03:19 +0000 (+0000) Subject: RISC-V: Make sure stack is always aligned during adjusting stack. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9b922d6aaf143d35ed5f1c116f0a0702df6ae04c;p=gcc.git RISC-V: Make sure stack is always aligned during adjusting stack. gcc/ 2018-04-20 Kito Cheng * config/riscv/riscv.c (riscv_first_stack_step): Round up min step to make sure stack always aligned. From-SVN: r259530 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1702d952023..d25e3e30a68 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-04-20 Kito Cheng + + * config/riscv/riscv.c (riscv_first_stack_step): Round up min + step to make sure stack always aligned. + 2018-04-20 Carl Love PR target/83402 diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c index 2870177fa97..2a8f87d1e94 100644 --- a/gcc/config/riscv/riscv.c +++ b/gcc/config/riscv/riscv.c @@ -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);