mirror of https://github.com/golang/go.git
cmd/compile: fix race in SSA construction
syslook cannot be called safely during SSA construction. Change-Id: Ief173babd2e964fd5016578073dd3ba12e5731c5 Reviewed-on: https://go-review.googlesource.com/107815 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
0a4b962c17
commit
581331e75b
|
|
@ -304,7 +304,9 @@ var (
|
||||||
racewriterange,
|
racewriterange,
|
||||||
msanread,
|
msanread,
|
||||||
msanwrite,
|
msanwrite,
|
||||||
Udiv *obj.LSym
|
Udiv,
|
||||||
|
supportPopcnt,
|
||||||
|
supportSSE41 *obj.LSym
|
||||||
|
|
||||||
// GO386=387
|
// GO386=387
|
||||||
ControlWord64trunc,
|
ControlWord64trunc,
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,8 @@ func initssaconfig() {
|
||||||
msanread = sysfunc("msanread")
|
msanread = sysfunc("msanread")
|
||||||
msanwrite = sysfunc("msanwrite")
|
msanwrite = sysfunc("msanwrite")
|
||||||
Udiv = sysfunc("udiv")
|
Udiv = sysfunc("udiv")
|
||||||
|
supportPopcnt = sysfunc("support_popcnt")
|
||||||
|
supportSSE41 = sysfunc("support_sse41")
|
||||||
|
|
||||||
// GO386=387 runtime functions
|
// GO386=387 runtime functions
|
||||||
ControlWord64trunc = sysfunc("controlWord64trunc")
|
ControlWord64trunc = sysfunc("controlWord64trunc")
|
||||||
|
|
@ -3019,8 +3021,7 @@ func init() {
|
||||||
|
|
||||||
makeRoundAMD64 := func(op ssa.Op) func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
|
makeRoundAMD64 := func(op ssa.Op) func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
|
||||||
return func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
|
return func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
|
||||||
aux := syslook("support_sse41").Sym.Linksym()
|
addr := s.entryNewValue1A(ssa.OpAddr, types.Types[TBOOL].PtrTo(), supportSSE41, s.sb)
|
||||||
addr := s.entryNewValue1A(ssa.OpAddr, types.Types[TBOOL].PtrTo(), aux, s.sb)
|
|
||||||
v := s.load(types.Types[TBOOL], addr)
|
v := s.load(types.Types[TBOOL], addr)
|
||||||
b := s.endBlock()
|
b := s.endBlock()
|
||||||
b.Kind = ssa.BlockIf
|
b.Kind = ssa.BlockIf
|
||||||
|
|
@ -3183,8 +3184,7 @@ func init() {
|
||||||
sys.ARM64)
|
sys.ARM64)
|
||||||
makeOnesCountAMD64 := func(op64 ssa.Op, op32 ssa.Op) func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
|
makeOnesCountAMD64 := func(op64 ssa.Op, op32 ssa.Op) func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
|
||||||
return func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
|
return func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
|
||||||
aux := syslook("support_popcnt").Sym.Linksym()
|
addr := s.entryNewValue1A(ssa.OpAddr, types.Types[TBOOL].PtrTo(), supportPopcnt, s.sb)
|
||||||
addr := s.entryNewValue1A(ssa.OpAddr, types.Types[TBOOL].PtrTo(), aux, s.sb)
|
|
||||||
v := s.load(types.Types[TBOOL], addr)
|
v := s.load(types.Types[TBOOL], addr)
|
||||||
b := s.endBlock()
|
b := s.endBlock()
|
||||||
b.Kind = ssa.BlockIf
|
b.Kind = ssa.BlockIf
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue