aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorOleg Endo <olegendo@gcc.gnu.org>2012-05-06 22:38:57 +0000
committerOleg Endo <olegendo@gcc.gnu.org>2012-05-06 22:38:57 +0000
commit0345d1dd2aa75e7af92059cb6bb4a0c0e0570d0b (patch)
tree3ca1d4518bb8bfe8bf9ddee038c0f0f9d445f68d /gcc
parent69f088a73a1924110328eac91bcbd8a98f64f62a (diff)
downloadgcc-0345d1dd2aa75e7af92059cb6bb4a0c0e0570d0b.zip
gcc-0345d1dd2aa75e7af92059cb6bb4a0c0e0570d0b.tar.gz
gcc-0345d1dd2aa75e7af92059cb6bb4a0c0e0570d0b.tar.bz2
re PR target/53250 ([SH] ICE: in change_address_1, at emit-rtl.c:2018)
PR target/53250 * config/sh/sh.c (sh_rtx_costs): Handle SET. From-SVN: r187218
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/sh/sh.c21
2 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index eab0576..aa909e3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-07 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/53250
+ * config/sh/sh.c (sh_rtx_costs): Handle SET.
+
2012-05-06 Uros Bizjak <ubizjak@gmail.com>
PR target/53227
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index d863474..08ee5b4 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -2999,6 +2999,27 @@ sh_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED,
{
switch (code)
{
+ /* The lower-subreg pass decides whether to split multi-word regs
+ into individual regs by looking at the cost for a SET of certain
+ modes with the following patterns:
+ (set (reg) (reg))
+ (set (reg) (const_int 0))
+ On machines that support vector-move operations a multi-word move
+ is the same cost as individual reg move. On SH there is no
+ vector-move, so we have to provide the correct cost in the number
+ of move insns to load/store the reg of the mode in question. */
+ case SET:
+ if (register_operand (SET_DEST (x), VOIDmode)
+ && (register_operand (SET_SRC (x), VOIDmode)
+ || satisfies_constraint_Z (SET_SRC (x))))
+ {
+ const enum machine_mode mode = GET_MODE (SET_DEST (x));
+ *total = COSTS_N_INSNS (GET_MODE_SIZE (mode)
+ / mov_insn_size (mode, TARGET_SH2A));
+ return true;
+ }
+ return false;
+
case CONST_INT:
if (TARGET_SHMEDIA)
{