backport: re PR rtl-optimization/48596 ([SH] unable to find a register to spill in class 'FPUL_REGS')

Backported from mainline
	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.

From-SVN: r185714
This commit is contained in:
Kaz Kojima 2012-03-22 21:39:45 +00:00
parent 5745473914
commit cf42709fba
2 changed files with 20 additions and 3 deletions

View File

@ -1,3 +1,13 @@
2012-03-22 Kaz Kojima <kkojima@gcc.gnu.org>
Backported from mainline
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-22 Jakub Jelinek <jakub@redhat.com>
PR middle-end/52547

View File

@ -1,6 +1,6 @@
/* Output routines for GCC for Renesas / SuperH SH.
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Contributed by Steve Chamberlain (sac@cygnus.com).
Improved by Jim Wilson (wilson@cygnus.com).
@ -11497,8 +11497,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))