From 08223f7633e228cb4ab7a9125a50c4f8ce2e16bb Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Fri, 16 Feb 2018 15:03:17 +0100 Subject: [PATCH] combine: Fix problem with RTL checking As Jakub found, after my recent combine patch at least on x86 problems show up with RTL checking enabled. This is because the I2 generated by a successful instruction combination can write not only a register but it can also write a paradoxical subreg of one. This fixes it. * combine.c (try_combine): When adjusting LOG_LINKS for the destination that moved to I2, also allow destinations that are a paradoxical subreg (instead of a normal reg). From-SVN: r257736 --- gcc/ChangeLog | 6 ++++++ gcc/combine.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a5d5fdefe8a..332a38f69fc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-02-16 Segher Boessenkool + + * combine.c (try_combine): When adjusting LOG_LINKS for the destination + that moved to I2, also allow destinations that are a paradoxical + subreg (instead of a normal reg). + 2018-02-16 Oleg Endo PR target/83831 diff --git a/gcc/combine.c b/gcc/combine.c index c4d55eb85a4..6b761c609ae 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -4283,7 +4283,12 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0, if (GET_CODE (x) == PARALLEL) x = XVECEXP (newi2pat, 0, 0); - unsigned int regno = REGNO (SET_DEST (x)); + /* It can only be a SET of a REG or of a paradoxical SUBREG of a REG. */ + x = SET_DEST (x); + if (paradoxical_subreg_p (x)) + x = SUBREG_REG (x); + + unsigned int regno = REGNO (x); bool done = false; for (rtx_insn *insn = NEXT_INSN (i3); -- 2.30.2