This is the mail archive of the gcc-patches@gcc.gnu.org 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


Hi!

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.

Stephane

2004-06-06 Stephane Carrez <stcarrez@nerim.fr>

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

Index: config/m68hc11/m68hc11.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68hc11/m68hc11.md,v
retrieving revision 1.54.10.6
diff -u -p -r1.54.10.6 m68hc11.md
--- config/m68hc11/m68hc11.md	6 Jun 2004 13:50:27 -0000	1.54.10.6
+++ config/m68hc11/m68hc11.md	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.
+;;
 (define_peephole2
   [(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))]
   "TARGET_M6812"
-  [(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]