SH: udivsi3_i4 clobbers T register

kaz Kojima kkojima@rr.iij4u.or.jp
Sun Nov 26 06:07:00 GMT 2000


Without the attached patch, the stage1 compiler for sh-*-linux-gnu
target goes into an infinite loop on SH-4. The function udivsi3_i4
in sh/lib1funcs.asm clobbers T register, so it seems to be obvious.

	kaz
--
	* gcc/config/sh/sh.md (udivsi3_i4, udivsi3_i4_single): Clobber
	T register.

Index: sh.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sh/sh.md,v
retrieving revision 1.65
diff -u -r1.65 sh.md
--- sh.md	2000/11/25 04:57:39	1.65
+++ sh.md	2000/11/26 03:08:00
@@ -980,6 +980,7 @@
 (define_insn "udivsi3_i4"
   [(set (match_operand:SI 0 "register_operand" "=y")
 	(udiv:SI (reg:SI R4_REG) (reg:SI R5_REG)))
+   (clobber (reg:SI T_REG))
    (clobber (reg:SI PR_REG))
    (clobber (reg:DF DR0_REG))
    (clobber (reg:DF DR2_REG))
@@ -999,6 +1000,7 @@
 (define_insn "udivsi3_i4_single"
   [(set (match_operand:SI 0 "register_operand" "=y")
 	(udiv:SI (reg:SI R4_REG) (reg:SI R5_REG)))
+   (clobber (reg:SI T_REG))
    (clobber (reg:SI PR_REG))
    (clobber (reg:DF DR0_REG))
    (clobber (reg:DF DR2_REG))


More information about the Gcc-patches mailing list