diff options
author | DJ Delorie <dj@redhat.com> | 2006-11-13 21:29:46 -0500 |
---|---|---|
committer | DJ Delorie <dj@gcc.gnu.org> | 2006-11-13 21:29:46 -0500 |
commit | 833bf445b05c6b15b8d3af23ba965c85e5d7f56a (patch) | |
tree | e9d1abd98ef15ba860773347f178d3441df3daf6 /gcc | |
parent | 8b3c6c5a91301fc5fb7e1d2246e2882f2d061847 (diff) | |
download | gcc-833bf445b05c6b15b8d3af23ba965c85e5d7f56a.zip gcc-833bf445b05c6b15b8d3af23ba965c85e5d7f56a.tar.gz gcc-833bf445b05c6b15b8d3af23ba965c85e5d7f56a.tar.bz2 |
m32c.c (m32c_prepare_shift): Use a separate temporary for intermediates.
* config/m32c/m32c.c (m32c_prepare_shift): Use a separate
temporary for intermediates.
From-SVN: r118798
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/m32c/m32c.c | 12 |
2 files changed, 12 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ecdbbf8..a1830a7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2006-11-13 DJ Delorie <dj@redhat.com> + + * config/m32c/m32c.c (m32c_prepare_shift): Use a separate + temporary for intermediates. + 2006-11-13 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (expand_cbranchdi4): Initialize skip_label. diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 6846787..dcfbe6e 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -3423,7 +3423,7 @@ m32c_prepare_shift (rtx * operands, int scale, int shift_code) undefined to skip one of the comparisons. */ rtx count; - rtx label, lref, insn; + rtx label, lref, insn, tempvar; emit_move_insn (operands[0], operands[1]); @@ -3432,13 +3432,15 @@ m32c_prepare_shift (rtx * operands, int scale, int shift_code) lref = gen_rtx_LABEL_REF (VOIDmode, label); LABEL_NUSES (label) ++; + tempvar = gen_reg_rtx (mode); + if (shift_code == ASHIFT) { /* This is a left shift. We only need check positive counts. */ emit_jump_insn (gen_cbranchqi4 (gen_rtx_LE (VOIDmode, 0, 0), count, GEN_INT (16), label)); - emit_insn (func (operands[0], operands[0], GEN_INT (8))); - emit_insn (func (operands[0], operands[0], GEN_INT (8))); + emit_insn (func (tempvar, operands[0], GEN_INT (8))); + emit_insn (func (operands[0], tempvar, GEN_INT (8))); insn = emit_insn (gen_addqi3 (count, count, GEN_INT (-16))); emit_label_after (label, insn); } @@ -3447,8 +3449,8 @@ m32c_prepare_shift (rtx * operands, int scale, int shift_code) /* This is a right shift. We only need check negative counts. */ emit_jump_insn (gen_cbranchqi4 (gen_rtx_GE (VOIDmode, 0, 0), count, GEN_INT (-16), label)); - emit_insn (func (operands[0], operands[0], GEN_INT (-8))); - emit_insn (func (operands[0], operands[0], GEN_INT (-8))); + emit_insn (func (tempvar, operands[0], GEN_INT (-8))); + emit_insn (func (operands[0], tempvar, GEN_INT (-8))); insn = emit_insn (gen_addqi3 (count, count, GEN_INT (16))); emit_label_after (label, insn); } |