aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2018-02-16 15:03:17 +0100
committerSegher Boessenkool <segher@gcc.gnu.org>2018-02-16 15:03:17 +0100
commit08223f7633e228cb4ab7a9125a50c4f8ce2e16bb (patch)
tree470a980952821c1d316a6e38bde85d66252e859f /gcc/combine.c
parentd960ab7b8daceba84413b25d91c2410eec1bbde2 (diff)
downloadgcc-08223f7633e228cb4ab7a9125a50c4f8ce2e16bb.zip
gcc-08223f7633e228cb4ab7a9125a50c4f8ce2e16bb.tar.gz
gcc-08223f7633e228cb4ab7a9125a50c4f8ce2e16bb.tar.bz2
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
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index c4d55eb..6b761c6 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);