diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-01-22 22:27:47 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-01-22 22:27:47 +0000 |
commit | 3888eedd894b7bfb3b3080e59ff66f6091a3fdc9 (patch) | |
tree | f6cd942ff09ad36a0c1afc80f243cd5ceb433923 /gcc/combine.c | |
parent | a56d0856a42a94caa099400470cce1ab94bb612c (diff) | |
download | gcc-3888eedd894b7bfb3b3080e59ff66f6091a3fdc9.tar.gz |
PR rtl-optimization/34628
* combine.c (try_combine): Stop and undo after the first combination
if an autoincrement side-effect on the first insn has effectively
been lost.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131744 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 43623a4fbc4..5cfa3051b0d 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -2751,12 +2751,17 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) if (i1 && GET_CODE (newpat) != CLOBBER) { - /* Before we can do this substitution, we must redo the test done - above (see detailed comments there) that ensures that I1DEST - isn't mentioned in any SETs in NEWPAT that are field assignments. */ - - if (! combinable_i3pat (NULL_RTX, &newpat, i1dest, NULL_RTX, - 0, (rtx*) 0)) + /* Check that an autoincrement side-effect on I1 has not been lost. + This happens if I1DEST is mentioned in I2 and dies there, and + has disappeared from the new pattern. */ + if ((FIND_REG_INC_NOTE (i1, NULL_RTX) != 0 + && !i1_feeds_i3 + && dead_or_set_p (i2, i1dest) + && !reg_overlap_mentioned_p (i1dest, newpat)) + /* Before we can do this substitution, we must redo the test done + above (see detailed comments there) that ensures that I1DEST + isn't mentioned in any SETs in NEWPAT that are field assignments. */ + || !combinable_i3pat (NULL_RTX, &newpat, i1dest, NULL_RTX, 0, 0)) { undo_all (); return 0; |