]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: fix SSA type for first runtime call arg/result
authorJosh Bleecher Snyder <josharian@gmail.com>
Wed, 8 Mar 2017 20:48:04 +0000 (12:48 -0800)
committerJosh Bleecher Snyder <josharian@gmail.com>
Fri, 10 Mar 2017 01:02:14 +0000 (01:02 +0000)
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: Michael Munday <munday@ca.ibm.com>
src/cmd/compile/internal/gc/ssa.go

index 6c442b4095c572371276ec5a2204d46403508fa9..c9a5ec42bd467d5d4834a9a83780d277a1b50900 100644 (file)
@@ -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()
        }