diff mbox series

combine: Don't make log_links for pc_rtx (PR84780 #c10)

Message ID 0b1b435fba46445e1e6cdf0cdb5a8a78bd67068a.1521029106.git.segher@kernel.crashing.org
State New
Headers show
Series combine: Don't make log_links for pc_rtx (PR84780 #c10) | expand

Commit Message

Segher Boessenkool March 14, 2018, 1:43 p.m. UTC
distribute_links tries to place a log_link for whatever the destination
of the modified instruction is.  It shouldn't do that when that dest
is pc_rtx, which isn't actually a register.

Committing to trunk.


Segher


2018-03-14  Segher Boessenkool  <segher@kernel.crashing.org>

	* combine.c (distribute_links): Don't make a link based on pc_rtx.

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

Patch

diff --git a/gcc/combine.c b/gcc/combine.c
index 0a447b9..eaebe65 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -14812,6 +14812,9 @@  distribute_links (struct insn_link *links)
 	     || GET_CODE (reg) == SUBREG)
 	reg = XEXP (reg, 0);
 
+      if (reg == pc_rtx)
+	continue;
+
       /* A LOG_LINK is defined as being placed on the first insn that uses
 	 a register and points to the insn that sets the register.  Start
 	 searching at the next insn after the target of the link and stop