Commit 361292be by Chung-Ju Wu Committed by Chung-Ju Wu

[NDS32] Fix wrong input value of parameter from stack for variable-length function.

gcc/
	* config/nds32/nds32.c (nds32_compute_stack_frame): Fix wrong value.

From-SVN: r259549
parent 79498ad8
2018-04-22 Chung-Ju Wu <jasonwucj@gmail.com>
* config/nds32/nds32.c (nds32_compute_stack_frame): Fix wrong value.
2018-04-22 Chung-Ju Wu <jasonwucj@gmail.com>
* config/nds32/nds32-protos.h (nds32_data_alignment,
nds32_local_alignment): Declare.
* config/nds32/nds32.c (nds32_data_alignment, nds32_constant_alignment,
......
......@@ -611,10 +611,12 @@ nds32_compute_stack_frame (void)
{
block_size = cfun->machine->fp_size
+ cfun->machine->gp_size
+ cfun->machine->lp_size
+ (4 * (cfun->machine->callee_saved_last_gpr_regno
- cfun->machine->callee_saved_first_gpr_regno
+ 1));
+ cfun->machine->lp_size;
if (cfun->machine->callee_saved_last_gpr_regno != SP_REGNUM)
block_size += (4 * (cfun->machine->callee_saved_last_gpr_regno
- cfun->machine->callee_saved_first_gpr_regno
+ 1));
if (!NDS32_DOUBLE_WORD_ALIGN_P (block_size))
{
......
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