From 6393e9d626ea2410a914e8374967e7ecc4e3a22b Mon Sep 17 00:00:00 2001 From: Joern Rennecke Date: Wed, 15 Oct 2014 09:04:12 +0000 Subject: [PATCH] As discussed: https://gcc.gnu.org/ml/gcc-patches/2014-10/msg00420.html 2014-10-15 Joern Rennecke Jeff Law * caller-save.c (replace_reg_with_saved_mem): If saved_mode covers multiple hard registers, use smaller mode derived from MODE. Co-Authored-By: Jeff Law From-SVN: r216243 --- gcc/ChangeLog | 6 ++++++ gcc/caller-save.c | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4316fa268ad..dc672ca2bc9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-10-15 Joern Rennecke + Jeff Law + + * caller-save.c (replace_reg_with_saved_mem): If saved_mode covers + multiple hard registers, use smaller mode derived from MODE. + 2014-10-15 Andreas Schwab * explow.c (convert_memory_address_addr_space_1): Mark in_const 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); } } -- 2.30.2