diff options
author | Jie Zhang <jie@codesourcery.com> | 2010-10-25 09:37:19 +0000 |
---|---|---|
committer | Jie Zhang <jiez@gcc.gnu.org> | 2010-10-25 09:37:19 +0000 |
commit | 8150f05c20bd3a41b337f37ce3badecf36abb259 (patch) | |
tree | 404145dc1174835483c3d92b3ac2df597b7b970a /gcc/combine.c | |
parent | 0ebd05fea230df81b2903f713ba1bd2ae6e99000 (diff) | |
download | gcc-8150f05c20bd3a41b337f37ce3badecf36abb259.zip gcc-8150f05c20bd3a41b337f37ce3badecf36abb259.tar.gz gcc-8150f05c20bd3a41b337f37ce3badecf36abb259.tar.bz2 |
combine.c (try_combine): If insns need to be kept around...
* combine.c (try_combine): If insns need to be kept around,
check that they can be copied in the merged instruction.
testsuite/
g++.dg/opt/combine.c: New test.
From-SVN: r165911
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 556228f7..5ec7ee3 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -2917,6 +2917,18 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p) else added_sets_0 = 0; + /* We are about to copy insns for the case where they need to be kept + around. Check that they can be copied in the merged instruction. */ + + if (targetm.cannot_copy_insn_p + && ((added_sets_2 && targetm.cannot_copy_insn_p (i2)) + || (i1 && added_sets_1 && targetm.cannot_copy_insn_p (i1)) + || (i0 && added_sets_0 && targetm.cannot_copy_insn_p (i0)))) + { + undo_all (); + return 0; + } + /* If the set in I2 needs to be kept around, we must make a copy of PATTERN (I2), so that when we substitute I1SRC for I1DEST in PATTERN (I2), we are only substituting for the original I1DEST, not into |