diff options
author | Kaz Kojima <kkojima@gcc.gnu.org> | 2012-03-02 23:59:08 +0000 |
---|---|---|
committer | Kaz Kojima <kkojima@gcc.gnu.org> | 2012-03-02 23:59:08 +0000 |
commit | 4978c73644d5e9035f4537e100efc7bf0b6ef497 (patch) | |
tree | 6e9e462c1b0f0462e33d31fd4961b192121b23d7 /gcc | |
parent | b98fcf6ecd5693f7b341bf419c5ef72b4647c304 (diff) | |
download | gcc-4978c73644d5e9035f4537e100efc7bf0b6ef497.zip gcc-4978c73644d5e9035f4537e100efc7bf0b6ef497.tar.gz gcc-4978c73644d5e9035f4537e100efc7bf0b6ef497.tar.bz2 |
re PR rtl-optimization/48596 ([SH] unable to find a register to spill in class 'FPUL_REGS')
PR target/48596
PR target/48806
* config/sh/sh.c (sh_register_move_cost): Increase cost between
GENERAL_REGS and FP_REGS for SImode.
From-SVN: r184844
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/sh/sh.c | 11 |
2 files changed, 16 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eabe45f..e2c179d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-03-02 Kaz Kojima <kkojima@gcc.gnu.org> + + PR target/48596 + PR target/48806 + * config/sh/sh.c (sh_register_move_cost): Increase cost between + GENERAL_REGS and FP_REGS for SImode. + 2012-03-02 Oleg Endo <olegendo@gcc.gnu.org> PR target/49486 diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 901a5a2..00258f4 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -11517,8 +11517,15 @@ sh_register_move_cost (enum machine_mode mode, && REGCLASS_HAS_GENERAL_REG (srcclass)) || (REGCLASS_HAS_GENERAL_REG (dstclass) && REGCLASS_HAS_FP_REG (srcclass))) - return ((TARGET_SHMEDIA ? 4 : TARGET_FMOVD ? 8 : 12) - * ((GET_MODE_SIZE (mode) + 7) / 8U)); + { + /* Discourage trying to use fp regs for a pointer. This also + discourages fp regs with SImode because Pmode is an alias + of SImode on this target. See PR target/48596. */ + int addend = (mode == Pmode) ? 40 : 0; + + return (((TARGET_SHMEDIA ? 4 : TARGET_FMOVD ? 8 : 12) + addend) + * ((GET_MODE_SIZE (mode) + 7) / 8U)); + } if ((dstclass == FPUL_REGS && REGCLASS_HAS_GENERAL_REG (srcclass)) |