aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Endo <olegendo@gcc.gnu.org>2016-09-27 12:50:27 +0000
committerOleg Endo <olegendo@gcc.gnu.org>2016-09-27 12:50:27 +0000
commit4e7e89e8c9acdbffa6546d5e6056c7b81238c88f (patch)
tree677a59b464fc53f71c9ba5c6c32fafb3e71a5433
parentf0d355dc5c46b1ae5b28fb8d05adec793c8c4891 (diff)
downloadgcc-4e7e89e8c9acdbffa6546d5e6056c7b81238c88f.zip
gcc-4e7e89e8c9acdbffa6546d5e6056c7b81238c88f.tar.gz
gcc-4e7e89e8c9acdbffa6546d5e6056c7b81238c88f.tar.bz2
re PR target/51244 ([SH] Inefficient conditional branch and code around T bit)
gcc/ PR target/51244 * config/sh/sh.c (sh_rtx_costs): Fix return value of SET of movt and movrt patterns. Match them before anything else in the SET case. From-SVN: r240533
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/sh/sh.c10
2 files changed, 12 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d0ebc8e5..0255b93 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2016-09-27 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/51244
+ * config/sh/sh.c (sh_rtx_costs): Fix return value of SET of movt and
+ movrt patterns. Match them before anything else in the SET case.
+
2016-09-27 Martin Liska <mliska@suse.cz>
PR gcov-profile/7970
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index bfa248d..e5b8088 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -3199,6 +3199,12 @@ sh_rtx_costs (rtx x, machine_mode mode ATTRIBUTE_UNUSED, int outer_code,
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 (sh_movt_set_dest (x) != NULL || sh_movrt_set_dest (x) != NULL)
+ {
+ *total = COSTS_N_INSNS (1);
+ return true;
+ }
+
if (register_operand (SET_DEST (x), VOIDmode)
&& (register_operand (SET_SRC (x), VOIDmode)
|| satisfies_constraint_Z (SET_SRC (x))))
@@ -3208,10 +3214,6 @@ sh_rtx_costs (rtx x, machine_mode mode ATTRIBUTE_UNUSED, int outer_code,
/ mov_insn_size (mode, TARGET_SH2A));
return true;
}
-
- if (sh_movt_set_dest (x) != NULL || sh_movrt_set_dest (x) != NULL)
- return COSTS_N_INSNS (1);
-
return false;
/* The cost of a mem access is mainly the cost of the address mode. */