From 4f44e960ea3c175eb8ec92b6872b8a2ef6775dba Mon Sep 17 00:00:00 2001 From: Chung-Ju Wu Date: Wed, 3 Sep 2014 09:44:49 +0000 Subject: [PATCH] [NDS32] Since argument pointer must be 8-byte alignment... [NDS32] Since argument pointer must be 8-byte alignment, our first parameter may require 4-byte offset if pushed varargs is not 8-byte aligned. * config/nds32/nds32.h (FIRST_PARM_OFFSET): Set proper location according to the value of crtl->args.pretend_args_size. From-SVN: r214863 --- gcc/ChangeLog | 5 +++++ gcc/config/nds32/nds32.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 31baaaddc4b..90be64a084d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-09-03 Chung-Ju Wu + + * config/nds32/nds32.h (FIRST_PARM_OFFSET): Set proper location + according to the value of crtl->args.pretend_args_size. + 2014-09-03 Chung-Ju Wu * config/nds32/nds32.c (nds32_compute_stack_frame): Prepare necessary diff --git a/gcc/config/nds32/nds32.h b/gcc/config/nds32/nds32.h index 3f4c3ae3d5c..d3336b6be13 100644 --- a/gcc/config/nds32/nds32.h +++ b/gcc/config/nds32/nds32.h @@ -671,7 +671,8 @@ enum reg_class #define STACK_POINTER_OFFSET 0 -#define FIRST_PARM_OFFSET(fundecl) 0 +#define FIRST_PARM_OFFSET(fundecl) \ + (NDS32_DOUBLE_WORD_ALIGN_P (crtl->args.pretend_args_size) ? 0 : 4) #define RETURN_ADDR_RTX(count, frameaddr) \ nds32_return_addr_rtx (count, frameaddr) -- 2.30.2