summaryrefslogtreecommitdiff
path: root/gcc/config/sh
diff options
context:
space:
mode:
authorolegendo <olegendo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-26 23:56:05 +0000
committerolegendo <olegendo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-26 23:56:05 +0000
commitda519e84eebe91ed7b121b2a57171d28e1fedb29 (patch)
treeee29468871e63260274fe84d0ff21a1e5b303dee /gcc/config/sh
parent6f195da7c61804cae9f48c42191e34e8ab9377bb (diff)
downloadgcc-da519e84eebe91ed7b121b2a57171d28e1fedb29.tar.gz
gcc/
PR target/49263 * config/sh/sh.c (sh_split_treg_set_expr): Invoke emit_insn before remove_insn. * config/sh/sh.md (tstsi_t): Don't try to optimize constant with right shifts if it already fits into K08. gcc/testsuite/ PR target/49263 * gcc.target/sh/pr49263-4.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220144 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/sh')
-rw-r--r--gcc/config/sh/sh.c4
-rw-r--r--gcc/config/sh/sh.md8
2 files changed, 8 insertions, 4 deletions
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 7d07634abe3..a7427f56288 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -14466,6 +14466,8 @@ sh_split_treg_set_expr (rtx x, rtx_insn* curr_insn)
fprintf (dump_file, "trailing nott insn %d\n", INSN_UID (nott_insn));
}
+ emit_insn (insnlist.first);
+
if (nott_insn != NULL && append_nott)
{
if (dump_file)
@@ -14475,8 +14477,6 @@ sh_split_treg_set_expr (rtx x, rtx_insn* curr_insn)
append_nott = false;
}
- emit_insn (insnlist.first);
-
if (append_nott)
nott_insn = emit_insn (gen_nott (get_t_reg_rtx ()));
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 956d1ef672e..4a39e12d8db 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -742,8 +742,12 @@
variant instead and load the constant into a reg. For that we'd need
to do some analysis. */
- if ((op1val & 0xFFFF) == 0
- && CONST_OK_FOR_K08 (op1val >> 16) && optimize_size)
+ if (CONST_OK_FOR_K08 (op1val))
+ {
+ /* Do nothing. */
+ }
+ else if ((op1val & 0xFFFF) == 0
+ && CONST_OK_FOR_K08 (op1val >> 16) && optimize_size)
{
/* Use a swap.w insn to do a shift + reg copy (to R0) in one insn. */
op1val = op1val >> 16;