Commit 678f35b6 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd/compile: fix SSA type for first runtime call arg/result

CLs 37254 and 37869 contained similar fixes.

Change-Id: I0cbf01c691b54d82acef398489df6e9c89ebb83f
Reviewed-on: https://go-review.googlesource.com/38000
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: default avatarMichael Munday <munday@ca.ibm.com>
parent c63ad970
......@@ -3364,10 +3364,7 @@ func (s *state) rtcall(fn *obj.LSym, returns bool, results []*Type, args ...*ssa
for _, arg := range args {
t := arg.Type
off = Rnd(off, t.Alignment())
ptr := s.sp
if off != 0 {
ptr = s.newValue1I(ssa.OpOffPtr, t.PtrTo(), off, s.sp)
}
ptr := s.newValue1I(ssa.OpOffPtr, t.PtrTo(), off, s.sp)
size := t.Size()
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, size, ptr, arg, s.mem())
off += size
......@@ -3398,10 +3395,7 @@ func (s *state) rtcall(fn *obj.LSym, returns bool, results []*Type, args ...*ssa
res := make([]*ssa.Value, len(results))
for i, t := range results {
off = Rnd(off, t.Alignment())
ptr := s.sp
if off != 0 {
ptr = s.newValue1I(ssa.OpOffPtr, ptrto(t), off, s.sp)
}
ptr := s.newValue1I(ssa.OpOffPtr, ptrto(t), off, s.sp)
res[i] = s.newValue2(ssa.OpLoad, t, ptr, s.mem())
off += t.Size()
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment