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]

Re: SH bootstrap failure


kaz Kojima wrote:
>         subc    r3,r4
>         mov.l   .L38,r1
>         jsr     @r1
>         subc    r4,r5
>         ...
> .L38:
>         .long   assemble_zeros
> --
> 
> It looks like that (r4, r5) pair is assigned to the DImode register
> 195 and (r3, r4) to a scratch register for total_bytes.
> Then a bad code for the subtraction is generated because r4 is shared
> with these two register pairs.

The problem is that the output is written to before all the inputs are
evaluated.  Such an output is known as an earlyclobber operand.
Please check if the attached patch works for you.
	
-- 
--------------------------
SuperH (UK) Ltd.
2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX
T:+44 1454 465658
2003-06-11  J"orn Rennecke <joern.rennecke@superh.com>

	* sh.md (adddi3_compact, subdi3_compact): Add earlyclobber
	constraint modifier for operand 0.

Index: config/sh/sh.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.md,v
retrieving revision 1.145
diff -p -r1.145 sh.md
*** config/sh/sh.md	14 May 2003 07:29:53 -0000	1.145
--- config/sh/sh.md	11 Jun 2003 15:50:13 -0000
***************
*** 1014,1020 ****
    [(set_attr "type" "arith_media")])
  
  (define_insn "adddi3_compact"
!   [(set (match_operand:DI 0 "arith_reg_operand" "=r")
  	(plus:DI (match_operand:DI 1 "arith_reg_operand" "%0")
  		 (match_operand:DI 2 "arith_reg_operand" "r")))
     (clobber (reg:SI T_REG))]
--- 1014,1020 ----
    [(set_attr "type" "arith_media")])
  
  (define_insn "adddi3_compact"
!   [(set (match_operand:DI 0 "arith_reg_operand" "=&r")
  	(plus:DI (match_operand:DI 1 "arith_reg_operand" "%0")
  		 (match_operand:DI 2 "arith_reg_operand" "r")))
     (clobber (reg:SI T_REG))]
***************
*** 1122,1128 ****
    [(set_attr "type" "arith_media")])
  
  (define_insn "subdi3_compact"
!   [(set (match_operand:DI 0 "arith_reg_operand" "=r")
  	(minus:DI (match_operand:DI 1 "arith_reg_operand" "0")
  		 (match_operand:DI 2 "arith_reg_operand" "r")))
     (clobber (reg:SI T_REG))]
--- 1122,1128 ----
    [(set_attr "type" "arith_media")])
  
  (define_insn "subdi3_compact"
!   [(set (match_operand:DI 0 "arith_reg_operand" "=&r")
  	(minus:DI (match_operand:DI 1 "arith_reg_operand" "0")
  		 (match_operand:DI 2 "arith_reg_operand" "r")))
     (clobber (reg:SI T_REG))]

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