public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] combine: Fix problem with RTL checking
@ 2018-02-16 13:53 Segher Boessenkool
  0 siblings, 0 replies; only message in thread
From: Segher Boessenkool @ 2018-02-16 13:53 UTC (permalink / raw)
  To: gcc-patches; +Cc: jakub, Segher Boessenkool

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.

Tested on powerpc64-linux {-m64,-m32} and on x86_64-linux {-m64,-m32},
with --enable-checking=yes,rtl.  Committing it now.


Segher


2018-02-16  Segher Boessenkool  <segher@kernel.crashing.org>

	* 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).

---
 gcc/combine.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/combine.c b/gcc/combine.c
index c386f3a..cd4aaa4 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -4379,7 +4379,12 @@
       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);
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-16 13:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-16 13:53 [PATCH] combine: Fix problem with RTL checking Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).