[PATCH] Fix PR optimization/5854 (m68hc11 bootstrap problem)

Jakub Jelinek jakub@redhat.com
Sat Mar 23 03:16:00 GMT 2002


On Sat, Mar 23, 2002 at 11:57:49AM +0100, Stephane Carrez wrote:
>  o For HC11/HC12, clearing the memory is very inefficient.  The use of a temporary
>    register (in my case D) is really faster and smaller.

I don't know anything about HC1* timing, sorry. If it is inefficient, then
just disparage that alternatively as needed (see below).
Certainly when the hardware can do it, it should be provided to reload
as (last resort) alternative. It is better to use it than to ICE.

>  o it does not fix the source of the problem.  You just introduced a workarround
>    in the HC11/HC12 port.
> 
> The bug is really in gcc because it must not insert any instruction before
> the insns that save function parameters passed in hard registers.  If this rule 
> is broken (which is the case today), it can create spill failures during
> the reload pass for the SMALL_REGISTERS ports.  The problem is that inserting
> the pseudo clear too early extends the life time of hard registers used by
> input registers.
> 
> Everywhere in gcc there has been a special attention to keep the life time of
> hard registers as short as possible (until reload pass).  But now, this is no longer
> true due to initialize_uninitialized_subregs().

I don't say this shouldn't be changed, though I'm not sure if it should be
on 3.1 branch.

--- gcc/config/m68hc11/m68hc11.md.jj	Fri Mar 22 14:43:05 2002
+++ gcc/config/m68hc11/m68hc11.md	Sat Mar 23 12:11:04 2002
@@ -651,7 +651,7 @@
 ")
 
 (define_insn "movdi_internal"
-  [(set (match_operand:DI 0 "nonimmediate_operand" "=uS,U,!u,U,m,m,!u")
+  [(set (match_operand:DI 0 "nonimmediate_operand" "=??uS,U,!u,U,m,m,!u")
 	(match_operand:DI 1 "general_operand" "K,iU,iU,!u,mi,!u,!mu"))
    (clobber (match_scratch:HI 2 "=X,&d,&d,&d,&d,&d,&d"))]
   ""
@@ -687,7 +687,7 @@
 ")
 
 (define_insn "movdf_internal"
-  [(set (match_operand:DF 0 "nonimmediate_operand" "=uS,U,!u,U,m,m,!u")
+  [(set (match_operand:DF 0 "nonimmediate_operand" "=??uS,U,!u,U,m,m,!u")
 	(match_operand:DF 1 "general_operand" "G,iU,iU,!u,mi,!u,!mu"))
    (clobber (match_scratch:HI 2 "=X,&d,&d,&d,&d,&d,&d"))]
   ""
@@ -732,7 +732,7 @@
 ")
 
 (define_insn "movsi_internal"
-  [(set (match_operand:SI 0 "nonimmediate_operand" "=uS,mu,?D,m,?D,?u,?u,!u,D")
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=??uS,mu,?D,m,?D,?u,?u,!u,D")
 	(match_operand:SI 1 "general_operand"      "K,imu,im,?D,!u,?D,mi,!u,!D"))
    (clobber (match_scratch:HI 2                    "=X,&d,X,X,X,X,&d,&d,X"))]
   ""
@@ -768,7 +768,7 @@
 ")
 
 (define_insn "movsf_internal"
-  [(set (match_operand:SF 0 "nonimmediate_operand" "=S!u,m,D,m,D,!u,!u,!u,D")
+  [(set (match_operand:SF 0 "nonimmediate_operand" "=??uS,m,D,m,D,!u,!u,!u,D")
 	(match_operand:SF 1 "general_operand" "G,im,im,D,!u,D,mi,!u,!D"))
    (clobber (match_scratch:HI 2 "=X,&d,X,X,X,X,&d,&d,X"))]
   ""


	Jakub



More information about the Gcc-patches mailing list