diff mbox series

combine: Don't do make_more_copies for dest PC (PR87720)

Message ID 8c86770a7b76361de63aa7c858a14881d0d571fd.1540419757.git.segher@kernel.crashing.org
State New
Headers show
Series combine: Don't do make_more_copies for dest PC (PR87720) | expand

Commit Message

Segher Boessenkool Oct. 24, 2018, 10:31 p.m. UTC
Jumps are written in RTL as moves to PC.  But the latter has no mode,
so we shouldn't try to use it.  Since the optimization this routine
does does not really help for jumps at all, let's just skip it.

Committing.


2018-10-24  Segher Boessenkool  <segher@kernel.crashing.org>

	PR rtl-optimization/87720
	* combine.c (make_more_copies): Skip if the dest is pc_rtx.

---
 gcc/combine.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/gcc/combine.c b/gcc/combine.c
index 3ff1760..bd593bdc 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -14992,6 +14992,8 @@  make_more_copies (void)
 	    continue;
 	  rtx src = SET_SRC (set);
 	  rtx dest = SET_DEST (set);
+	  if (dest == pc_rtx)
+	    continue;
 	  if (GET_CODE (src) == SUBREG)
 	    src = SUBREG_REG (src);
 	  if (!(REG_P (src) && HARD_REGISTER_P (src)))