]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: mark ARM's CALLudiv not safepoint
authorCherry Zhang <cherryyz@google.com>
Fri, 21 Apr 2017 10:50:02 +0000 (06:50 -0400)
committerCherry Zhang <cherryyz@google.com>
Fri, 21 Apr 2017 22:06:29 +0000 (22:06 +0000)
ARM's udiv function is nosplit and it shouldn't be preemptied
(passing args in registers). It is in some sense like DUFFCOPY,
which we don't mark as safepoint.

Change-Id: I49f7c4e69e787ac364d0b0def0661e79a0ea9e69
Reviewed-on: https://go-review.googlesource.com/41370
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/arm/ssa.go
src/cmd/compile/internal/gc/plive.go

index 8faaf0ffb8e0c56a1f971227bf73e06508d3a439..ea9c3a9cc1ce2be7cc3c1e06fa0e07e5af97f7c2 100644 (file)
@@ -625,8 +625,10 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
        case ssa.OpARMCALLstatic, ssa.OpARMCALLclosure, ssa.OpARMCALLinter:
                s.Call(v)
        case ssa.OpARMCALLudiv:
-               v.Aux = gc.Udiv
-               s.Call(v)
+               p := s.Prog(obj.ACALL)
+               p.To.Type = obj.TYPE_MEM
+               p.To.Name = obj.NAME_EXTERN
+               p.To.Sym = gc.Udiv
        case ssa.OpARMDUFFZERO:
                p := s.Prog(obj.ADUFFZERO)
                p.To.Type = obj.TYPE_MEM
index 4525426d4f31c7255d53ebf882eeb305a90a31a4..96fbb327f283818916524959e46506df7ef80b03 100644 (file)
@@ -502,7 +502,7 @@ func onebitlivepointermap(lv *Liveness, liveout bvec, vars []*Node, args bvec, l
 // Returns true for instructions that are safe points that must be annotated
 // with liveness information.
 func issafepoint(v *ssa.Value) bool {
-       return v.Op.IsCall() || v.Op == ssa.OpARMCALLudiv
+       return v.Op.IsCall()
 }
 
 // Initializes the sets for solving the live variables. Visits all the