mirror of
https://github.com/golang/go
synced 2024-10-05 20:21:21 -06:00
[dev.ssa] cmd/compile: respect Xoffset of static data
Together with teaching SSA to generate static data, this fixes the encoding/pem and hash/adler32 tests. Change-Id: I75f81f6c995dcb9c6d99bd3acda94a4feea8b87b Reviewed-on: https://go-review.googlesource.com/12791 Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
6b41665039
commit
67df7934cc
@ -1161,7 +1161,12 @@ func (s *state) addr(n *Node) *ssa.Value {
|
|||||||
case PEXTERN:
|
case PEXTERN:
|
||||||
// global variable
|
// global variable
|
||||||
aux := &ssa.ExternSymbol{n.Type, n.Sym}
|
aux := &ssa.ExternSymbol{n.Type, n.Sym}
|
||||||
return s.entryNewValue1A(ssa.OpAddr, Ptrto(n.Type), aux, s.sb)
|
v := s.entryNewValue1A(ssa.OpAddr, Ptrto(n.Type), aux, s.sb)
|
||||||
|
// TODO: Make OpAddr use AuxInt as well as Aux.
|
||||||
|
if n.Xoffset != 0 {
|
||||||
|
v = s.entryNewValue1I(ssa.OpOffPtr, v.Type, n.Xoffset, v)
|
||||||
|
}
|
||||||
|
return v
|
||||||
case PPARAM, PPARAMOUT, PAUTO:
|
case PPARAM, PPARAMOUT, PAUTO:
|
||||||
// parameter/result slot or local variable
|
// parameter/result slot or local variable
|
||||||
v := s.decladdrs[n]
|
v := s.decladdrs[n]
|
||||||
|
Loading…
Reference in New Issue
Block a user