From 4978c73644d5e9035f4537e100efc7bf0b6ef497 Mon Sep 17 00:00:00 2001 From: Kaz Kojima Date: Fri, 2 Mar 2012 23:59:08 +0000 Subject: 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 --- gcc/ChangeLog | 7 +++++++ gcc/config/sh/sh.c | 11 +++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'gcc') 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 + + 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 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)) -- cgit v1.1