nodfp is a global, so modifying it is unsafe in a concurrent backend.
It is also not necessary, since the Used marks
are only relevant for nodes in fn.Dcl.
For good measure, mark nodfp as always used.
Passes toolstash-check.
Updates #15756
Change-Id: I5320459f5eced2898615a17b395a10c1064bcaf5
Reviewed-on: https://go-review.googlesource.com/39200
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
if ls, ok := l.(ssa.LocalSlot); ok {
ls.N.(*Node).SetUsed(true)
}
-
}
scratchUsed := false
for _, v := range b.Values {
switch a := v.Aux.(type) {
case *ssa.ArgSymbol:
- a.Node.(*Node).SetUsed(true)
+ n := a.Node.(*Node)
+ // Don't modify nodfp; it is a global.
+ if n != nodfp {
+ n.SetUsed(true)
+ }
case *ssa.AutoSymbol:
a.Node.(*Node).SetUsed(true)
}
nodfp = newname(lookup(".fp"))
nodfp.Type = Types[TINT32]
nodfp.Class = PPARAM
+ nodfp.SetUsed(true)
}