1
0
mirror of https://github.com/golang/go synced 2024-10-05 16:41: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:
Josh Bleecher Snyder 2015-07-28 11:08:44 -07:00
parent 6b41665039
commit 67df7934cc

View File

@ -1161,7 +1161,12 @@ func (s *state) addr(n *Node) *ssa.Value {
case PEXTERN:
// global variable
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:
// parameter/result slot or local variable
v := s.decladdrs[n]