diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2018-03-12 16:26:16 +0100 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2018-03-12 16:26:16 +0100 |
commit | fb54f550a047a40ff1438c5cfb890114baa31191 (patch) | |
tree | 0f6b19f946512482f7a72b2fb66daba7a03058d0 /gcc | |
parent | d67b5d8d1db0b9dff3e123a8e2be31cd5634821a (diff) | |
download | gcc-fb54f550a047a40ff1438c5cfb890114baa31191.zip gcc-fb54f550a047a40ff1438c5cfb890114baa31191.tar.gz gcc-fb54f550a047a40ff1438c5cfb890114baa31191.tar.bz2 |
combine: Fix PR84780 (more LOG_LINKS trouble)
There still are situations where we have stale LOG_LINKS. This causes
combine to try two-insn combinations I2->I3 where the register set by
I2 is used before I3 as well. Not good.
This patch fixes it by checking for this situation in can_combine_p
(similar to what we already do for three and four insn combinations).
From-SVN: r258452
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/combine.c | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 548de75..cbdd4d2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-03-12 Segher Boessenkool <segher@kernel.crashing.org> + + PR rtl-optimization/84169 + PR rtl-optimization/84780 + * combine.c (can_combine_p): Check for a 2-insn combination whether + the destination register is used between the two insns, too. + 2018-03-12 Richard Biener <rguenther@suse.de> PR tree-optimization/84803 diff --git a/gcc/combine.c b/gcc/combine.c index c9105ed..06a9ddd 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -1990,6 +1990,7 @@ can_combine_p (rtx_insn *insn, rtx_insn *i3, rtx_insn *pred ATTRIBUTE_UNUSED, && (reg_used_between_p (dest, succ2, i3) || reg_used_between_p (dest, succ, succ2))) || (!succ2 && succ && reg_used_between_p (dest, succ, i3)) + || (!succ2 && !succ && reg_used_between_p (dest, insn, i3)) || (succ /* SUCC and SUCC2 can be split halves from a PARALLEL; in that case SUCC is not in the insn stream, so use SUCC2 |