diff options
author | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-10-15 09:04:12 +0000 |
---|---|---|
committer | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-10-15 09:04:12 +0000 |
commit | e9ba91abe257ee9898d26b645710dfc7a8c0210f (patch) | |
tree | 97aa7e24bf72969a22733b989f0562b4027b5464 /gcc/caller-save.c | |
parent | 3e26fb5f00330bead06a74057e3e2ec1f10af7bc (diff) | |
download | gcc-e9ba91abe257ee9898d26b645710dfc7a8c0210f.tar.gz |
As discussed: https://gcc.gnu.org/ml/gcc-patches/2014-10/msg00420.html
2014-10-15 Joern Rennecke <joern.rennecke@embecosm.com>
Jeff Law <law@redhat.com>
* caller-save.c (replace_reg_with_saved_mem): If saved_mode covers
multiple hard registers, use smaller mode derived from MODE.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216243 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/caller-save.c')
-rw-r--r-- | gcc/caller-save.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/caller-save.c b/gcc/caller-save.c index e28facba7be..31b1a365b7a 100644 --- a/gcc/caller-save.c +++ b/gcc/caller-save.c @@ -1158,9 +1158,12 @@ replace_reg_with_saved_mem (rtx *loc, } else { - gcc_assert (save_mode[regno] != VOIDmode); - XVECEXP (mem, 0, i) = gen_rtx_REG (save_mode [regno], - regno + i); + enum machine_mode smode = save_mode[regno]; + gcc_assert (smode != VOIDmode); + if (hard_regno_nregs [regno][smode] > 1) + smode = mode_for_size (GET_MODE_SIZE (mode) / nregs, + GET_MODE_CLASS (mode), 0); + XVECEXP (mem, 0, i) = gen_rtx_REG (smode, regno + i); } } |