From: Josh Bleecher Snyder Date: Tue, 8 Aug 2017 23:38:25 +0000 (-0700) Subject: cmd/compile: remove gc.Sysfunc calls from 387 backend X-Git-Tag: go1.10beta1~1695 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2fe53d8d55e93602a8fcda7bf78385d93da58da4;p=gostls13.git cmd/compile: remove gc.Sysfunc calls from 387 backend gc.Sysfunc must not be called concurrently. We set up runtime routines used by the backend prior to doing any backend compilation. I missed the 387 ones; fix that. Sysfunc should have been unexported during 1.9. I will rectify that in a subsequent CL. Fixes #21352 Change-Id: I8386eaa1e05879c25c672b9c9fc693c938e9aeb6 Reviewed-on: https://go-review.googlesource.com/54090 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Keith Randall Reviewed-by: Avelino TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/compile/internal/gc/go.go b/src/cmd/compile/internal/gc/go.go index 65d8946849..b1ead93c34 100644 --- a/src/cmd/compile/internal/gc/go.go +++ b/src/cmd/compile/internal/gc/go.go @@ -293,4 +293,8 @@ var ( typedmemmove, typedmemclr, Udiv *obj.LSym + + // GO386=387 + ControlWord64trunc, + ControlWord32 *obj.LSym ) diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index 1497c5c2f5..9c1b3ca69f 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -92,6 +92,10 @@ func initssaconfig() { typedmemmove = Sysfunc("typedmemmove") typedmemclr = Sysfunc("typedmemclr") Udiv = Sysfunc("udiv") + + // GO386=387 runtime functions + ControlWord64trunc = Sysfunc("controlWord64trunc") + ControlWord32 = Sysfunc("controlWord32") } // buildssa builds an SSA function for fn. diff --git a/src/cmd/compile/internal/x86/387.go b/src/cmd/compile/internal/x86/387.go index 5bf14109b2..cdac000648 100644 --- a/src/cmd/compile/internal/x86/387.go +++ b/src/cmd/compile/internal/x86/387.go @@ -120,7 +120,7 @@ func ssaGenValue387(s *gc.SSAGenState, v *ssa.Value) { p = s.Prog(x86.AFLDCW) p.From.Type = obj.TYPE_MEM p.From.Name = obj.NAME_EXTERN - p.From.Sym = gc.Sysfunc("controlWord32") + p.From.Sym = gc.ControlWord32 } var op obj.As @@ -210,7 +210,7 @@ func ssaGenValue387(s *gc.SSAGenState, v *ssa.Value) { p = s.Prog(x86.AFLDCW) p.From.Type = obj.TYPE_MEM p.From.Name = obj.NAME_EXTERN - p.From.Sym = gc.Sysfunc("controlWord64trunc") + p.From.Sym = gc.ControlWord64trunc // Now do the conversion. p = s.Prog(x86.AFMOVLP)