diff options
author | Nathan Sidwell <nathan@acm.org> | 2017-01-12 13:54:43 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2017-01-12 13:54:43 +0000 |
commit | 0691440320ef57149c7a4ac056696e558d215af4 (patch) | |
tree | db9a2bdbdbcdfc1c32a29da0b9ba5d9edbec0eb1 | |
parent | 4bfe4a99e083e595ea1abca076b5a960803deaf8 (diff) | |
download | gcc-0691440320ef57149c7a4ac056696e558d215af4.zip gcc-0691440320ef57149c7a4ac056696e558d215af4.tar.gz gcc-0691440320ef57149c7a4ac056696e558d215af4.tar.bz2 |
combine.c (try_combine): Don't ignore result of overlap checking loop.
* combine.c (try_combine): Don't ignore result of overlap checking
loop. Combine overlap & asm check into single loop.
Co-Authored-By: Nicolai Stange <nicstange@gmail.com>
From-SVN: r244361
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/combine.c | 28 |
2 files changed, 21 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 012c095..da9d213 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-01-12 Nathan Sidwell <nathan@acm.org> + Nicolai Stange <nicstange@gmail.com> + + * combine.c (try_combine): Don't ignore result of overlap checking + loop. Combine overlap & asm check into single loop. + 2017-01-12 Richard Biener <rguenther@suse.de> * tree-pretty-print.c (dump_generic_node): Provide -gimple diff --git a/gcc/combine.c b/gcc/combine.c index 3043f2a..3598045 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -2785,22 +2785,24 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0, (Besides, reload can't handle output reloads for this.) The problem can also happen if the dest of I3 is a memory ref, - if another dest in I2 is an indirect memory ref. */ - for (i = 0; i < XVECLEN (p2, 0); i++) - if ((GET_CODE (XVECEXP (p2, 0, i)) == SET - || GET_CODE (XVECEXP (p2, 0, i)) == CLOBBER) - && reg_overlap_mentioned_p (SET_DEST (PATTERN (i3)), - SET_DEST (XVECEXP (p2, 0, i)))) - break; + if another dest in I2 is an indirect memory ref. - /* Make sure this PARALLEL is not an asm. We do not allow combining + Neither can this PARALLEL be an asm. We do not allow combining that usually (see can_combine_p), so do not here either. */ - for (i = 0; i < XVECLEN (p2, 0); i++) - if (GET_CODE (XVECEXP (p2, 0, i)) == SET - && GET_CODE (SET_SRC (XVECEXP (p2, 0, i))) == ASM_OPERANDS) - break; + bool ok = true; + for (i = 0; ok && i < XVECLEN (p2, 0); i++) + { + if ((GET_CODE (XVECEXP (p2, 0, i)) == SET + || GET_CODE (XVECEXP (p2, 0, i)) == CLOBBER) + && reg_overlap_mentioned_p (SET_DEST (PATTERN (i3)), + SET_DEST (XVECEXP (p2, 0, i)))) + ok = false; + else if (GET_CODE (XVECEXP (p2, 0, i)) == SET + && GET_CODE (SET_SRC (XVECEXP (p2, 0, i))) == ASM_OPERANDS) + ok = false; + } - if (i == XVECLEN (p2, 0)) + if (ok) for (i = 0; i < XVECLEN (p2, 0); i++) if (GET_CODE (XVECEXP (p2, 0, i)) == SET && SET_DEST (XVECEXP (p2, 0, i)) == SET_SRC (PATTERN (i3))) |