diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-12 19:25:39 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-12 19:25:39 +0000 |
commit | 31b4e36ed91066bfc8b6f8658ad52cfa18feacdd (patch) | |
tree | 98c6a9fe26fa7bee9171d2187ff16c6889e3cd1f /gcc/config/mips | |
parent | b4c50d780ff04de259d74e307dd3df11054e52c7 (diff) | |
download | gcc-31b4e36ed91066bfc8b6f8658ad52cfa18feacdd.tar.gz |
gcc/
* config/mips/mips.c (mips16e_save_restore_reg): Add a reg_parm_p
argument.
(mips16e_build_save_restore): Update accordingly.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178793 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/mips')
-rw-r--r-- | gcc/config/mips/mips.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index a0e93c53bb2..a5fed3dc89d 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -8365,20 +8365,22 @@ mips16e_collect_argument_saves (void) } /* Return a move between register REGNO and memory location SP + OFFSET. - Make the move a load if RESTORE_P, otherwise make it a frame-related - store. */ + REG_PARM_P is true if SP + OFFSET belongs to REG_PARM_STACK_SPACE. + Make the move a load if RESTORE_P, otherwise make it a store. */ static rtx -mips16e_save_restore_reg (bool restore_p, HOST_WIDE_INT offset, - unsigned int regno) +mips16e_save_restore_reg (bool restore_p, bool reg_parm_p, + HOST_WIDE_INT offset, unsigned int regno) { rtx reg, mem; mem = gen_frame_mem (SImode, plus_constant (stack_pointer_rtx, offset)); reg = gen_rtx_REG (SImode, regno); - return (restore_p - ? gen_rtx_SET (VOIDmode, reg, mem) - : mips_frame_set (mem, reg)); + if (restore_p) + return gen_rtx_SET (VOIDmode, reg, mem); + if (reg_parm_p) + return gen_rtx_SET (VOIDmode, mem, reg); + return mips_frame_set (mem, reg); } /* Return RTL for a MIPS16e SAVE or RESTORE instruction; RESTORE_P says which. @@ -8440,7 +8442,8 @@ mips16e_build_save_restore (bool restore_p, unsigned int *mask_ptr, for (i = 0; i < nargs; i++) { offset = top_offset + i * UNITS_PER_WORD; - set = mips16e_save_restore_reg (restore_p, offset, GP_ARG_FIRST + i); + set = mips16e_save_restore_reg (restore_p, true, offset, + GP_ARG_FIRST + i); XVECEXP (pattern, 0, n++) = set; } @@ -8452,7 +8455,7 @@ mips16e_build_save_restore (bool restore_p, unsigned int *mask_ptr, if (BITSET_P (*mask_ptr, regno)) { offset -= UNITS_PER_WORD; - set = mips16e_save_restore_reg (restore_p, offset, regno); + set = mips16e_save_restore_reg (restore_p, false, offset, regno); XVECEXP (pattern, 0, n++) = set; *mask_ptr &= ~(1 << regno); } |