]> git.ipfire.org Git - thirdparty/gcc.git/commit
combine: Update links correctly for new I2 (PR84169)
authorSegher Boessenkool <segher@kernel.crashing.org>
Tue, 13 Feb 2018 22:12:55 +0000 (23:12 +0100)
committerSegher Boessenkool <segher@gcc.gnu.org>
Tue, 13 Feb 2018 22:12:55 +0000 (23:12 +0100)
commitba95aa209678e681dcc86df9ebd0a39501c70187
tree9d2833672a93b6995ce058c172305d5c25c9e9c5
parentb7a6b85f8a3d6845ad99a3291b13bff6f788110c
combine: Update links correctly for new I2 (PR84169)

If there is a LOG_LINK between two insns, this means those two insns
can be combined, as far as dataflow is concerned.  There never should
be a LOG_LINK between two unrelated insns.  If there is one, combine
will try to combine the insns without doing all the needed checks if
the earlier destination is used before the later insn, etc.

Unfortunately we do not update the LOG_LINKs correctly in some cases.
This patch fixes at least some of those cases.

PR rtl-optimization/84169
* combine.c (try_combine): New variable split_i2i3.  Set it to true if
we generated a parallel as new i3 and we split that to new i2 and i3
instructions.  Handle split_i2i3 similar to swap_i2i3: scan the
LOG_LINKs of i3 to see which of those need to link to i2 now.  Link
those to i2, not i1.  Partially rewrite this scan code.

gcc/testsuite/
PR rtl-optimization/84169
* gcc.c-torture/execute/pr84169.c: New.

From-SVN: r257644
gcc/ChangeLog
gcc/combine.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr84169.c [new file with mode: 0644]