This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[SH][committed] Don't emit tstsi_t insn with const_int as first operand
- From: Oleg Endo <oleg dot endo at t-online dot de>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 08 Jan 2015 12:48:07 +0100
- Subject: [SH][committed] Don't emit tstsi_t insn with const_int as first operand
- Authentication-results: sourceware.org; auth=none
Hi,
While doing some other work on the tst insns, I ran into the issue that
in sh-mem.cc the tstsi_t insn is emitted with the const_int operand
being the first operand. Normally reload fixes this afterwards, but
let's not stress that.
Tested with make -k check RUNTESTFLAGS="--target_board=sh-sim
\{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}"
and no new failures. Committed as r219342.
Cheers,
Oleg
gcc/ChangeLog:
* config/sh/sh-mem.cc: Use constant as second operand when emitting
tstsi_t insns.
Index: gcc/config/sh/sh-mem.cc
===================================================================
--- gcc/config/sh/sh-mem.cc (revision 219292)
+++ gcc/config/sh/sh-mem.cc (working copy)
@@ -228,7 +228,7 @@
if (align < 4)
{
emit_insn (gen_iorsi3 (tmp1, s1_addr, s2_addr));
- emit_insn (gen_tstsi_t (GEN_INT (3), tmp1));
+ emit_insn (gen_tstsi_t (tmp1, GEN_INT (3)));
jump = emit_jump_insn (gen_branch_false (L_loop_byte));
add_int_reg_note (jump, REG_BR_PROB, prob_likely);
}
@@ -373,7 +373,7 @@
if (align < 4)
{
emit_insn (gen_iorsi3 (tmp1, s1_addr, s2_addr));
- emit_insn (gen_tstsi_t (GEN_INT (3), tmp1));
+ emit_insn (gen_tstsi_t (tmp1, GEN_INT (3)));
jump = emit_jump_insn (gen_branch_false (L_loop_byte));
add_int_reg_note (jump, REG_BR_PROB, prob_likely);
}
@@ -581,7 +581,7 @@
if (align < 4)
{
- emit_insn (gen_tstsi_t (GEN_INT (3), current_addr));
+ emit_insn (gen_tstsi_t (current_addr, GEN_INT (3)));
jump = emit_jump_insn (gen_branch_false (L_loop_byte));
add_int_reg_note (jump, REG_BR_PROB, prob_likely);
}
@@ -673,7 +673,7 @@
if (align < 4)
{
- emit_insn (gen_tstsi_t (GEN_INT (3), dest_addr));
+ emit_insn (gen_tstsi_t (dest_addr, GEN_INT (3)));
jump = emit_jump_insn (gen_branch_false (L_loop_byte));
add_int_reg_note (jump, REG_BR_PROB, prob_likely);
}