diff options
author | Kaz Kojima <kkojima@gcc.gnu.org> | 2011-06-01 22:36:08 +0000 |
---|---|---|
committer | Kaz Kojima <kkojima@gcc.gnu.org> | 2011-06-01 22:36:08 +0000 |
commit | e95873dd5bbab240f64c4ab8138646ead2e3bdfc (patch) | |
tree | 232ef5af44e2c3235f2cd52f53a50a63518761fa /gcc/config | |
parent | a82fcbe8255c5a3716710f27f08dc76ac16aeeca (diff) | |
download | gcc-e95873dd5bbab240f64c4ab8138646ead2e3bdfc.zip gcc-e95873dd5bbab240f64c4ab8138646ead2e3bdfc.tar.gz gcc-e95873dd5bbab240f64c4ab8138646ead2e3bdfc.tar.bz2 |
sh.c (expand_cbranchdi4): Use a scratch register if needed when original operands are used for msw_skip...
* config/sh/sh.c (expand_cbranchdi4): Use a scratch register if
needed when original operands are used for msw_skip comparison.
* gcc.c-torture/compile/pr49238.c: New.
From-SVN: r174550
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/sh/sh.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index fb204c6..c5fbd56 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -2199,6 +2199,13 @@ expand_cbranchdi4 (rtx *operands, enum rtx_code comparison) { operands[1] = op1h; operands[2] = op2h; + if (reload_completed + && ! arith_reg_or_0_operand (op2h, SImode) + && (true_regnum (op1h) || (comparison != EQ && comparison != NE))) + { + emit_move_insn (scratch, operands[2]); + operands[2] = scratch; + } } operands[3] = skip_label = gen_label_rtx (); |