This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH]: Fix target/14542: ICE on simple source


This patch fixes 14542.  The pb was due to a peephole2 replacement that
changes the liveness of register at block entry.  It occurred at function start
when a register is pushed to allocate a stack slot.  The stack slot is then filled
with another register (arg 0 in most cases).  The peephole2 creates the stack slot
with the initial value hence getting rid of the register used for the push.
Fixed by emitting a use of that register.

Committed on 3_4 and mainline.


2004-06-06 Stephane Carrez <>

	PR target/14542
	* config/m68hc11/ (move peephole2): Emit a use note to avoid
	a live change of a register after peephole replacement.

Index: config/m68hc11/
RCS file: /cvs/gcc/gcc/gcc/config/m68hc11/,v
retrieving revision
diff -u -p -r1.54.10.6
--- config/m68hc11/	6 Jun 2004 13:50:27 -0000
+++ config/m68hc11/	6 Jun 2004 16:53:05 -0000
@@ -6922,6 +6922,11 @@
 				   gen_rtx_REG (HImode, HARD_SP_REGNUM)));")
 ;; Replace: "pshx; tfr d,x; stx 0,sp" into "pshd; tfr d,x"
+;; PR 14542: emit a use to pretend we need the value of initial register.
+;; Otherwise verify_local_live_at_start will abort due to a live change
+;; of that register.
   [(set (mem:HI (pre_dec:HI (reg:HI SP_REGNUM)))
         (match_operand:HI 0 "hard_reg_operand" ""))
@@ -6930,7 +6935,8 @@
    (set (mem:HI (reg:HI SP_REGNUM))
         (match_dup 0))]
-  [(set (mem:HI (pre_dec:HI (reg:HI SP_REGNUM)))
+  [(use (match_dup 0))
+   (set (mem:HI (pre_dec:HI (reg:HI SP_REGNUM)))
         (match_dup 1))
    (set (match_dup 0) (match_dup 1))]

Attachment: pgp00000.pgp
Description: PGP signature

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]