From: Chung-Ju Wu Date: Sun, 22 Apr 2018 10:10:00 +0000 (+0000) Subject: [NDS32] Add new option -malways-save-lp. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1311665187d54b68fc88f75685ccd28b6d3e2ebc;p=gcc.git [NDS32] Add new option -malways-save-lp. gcc/ * config/nds32/nds32.c (nds32_compute_stack_frame): Consider flag_always_save_lp condition. * config/nds32/nds32.opt (malways-save-lp): New option. From-SVN: r259553 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3aa554236ca..c9a0d04fc46 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-04-22 Chung-Ju Wu + + * config/nds32/nds32.c (nds32_compute_stack_frame): Consider + flag_always_save_lp condition. + * config/nds32/nds32.opt (malways-save-lp): New option. + 2018-04-22 Shiva Chen * config/nds32/nds32-protos.h (nds32_use_load_post_increment): Declare. diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c index 9a8c71204ea..8994c13d7b0 100644 --- a/gcc/config/nds32/nds32.c +++ b/gcc/config/nds32/nds32.c @@ -436,7 +436,8 @@ nds32_compute_stack_frame (void) /* If $lp value is required to be saved on stack, it needs 4 bytes space. Check whether $lp is ever live. */ - cfun->machine->lp_size = (df_regs_ever_live_p (LP_REGNUM)) ? 4 : 0; + cfun->machine->lp_size + = (flag_always_save_lp || df_regs_ever_live_p (LP_REGNUM)) ? 4 : 0; /* Initially there is no padding bytes. */ cfun->machine->callee_saved_area_gpr_padding_bytes = 0; diff --git a/gcc/config/nds32/nds32.opt b/gcc/config/nds32/nds32.opt index dd9b3d1b72c..dcf6d396bc3 100644 --- a/gcc/config/nds32/nds32.opt +++ b/gcc/config/nds32/nds32.opt @@ -321,6 +321,10 @@ mext-fpu-dp Target Report Mask(FPU_DOUBLE) Generate double-precision floating-point instructions. +malways-save-lp +Target Var(flag_always_save_lp) Init(0) +Always save $lp in the stack. + munaligned-access Target Report Var(flag_unaligned_access) Init(0) Enable unaligned word and halfword accesses to packed data.