Skip to content

Commit 211c8c9

Browse files
committed
cmd/compile: pass types on SSA Store/Move/Zero ops
For SSA Store/Move/Zero ops, attach the type of the value being stored to the op as the Aux field. This type will be used for write barrier insertion (in a followup CL). Since SSA passes do not accurately propagate types of values (because of type casting), we can't simply use type of the store's arguments for write barrier insertion. Passes "toolstash -cmp" on std. Updates #17583. Change-Id: I051d5e5c482931640d1d7d879b2a6bb91f2e0056 Reviewed-on: https://go-review.googlesource.com/36838 Run-TryBot: Cherry Zhang <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Keith Randall <[email protected]>
1 parent 77b09b8 commit 211c8c9

14 files changed

+217
-97
lines changed

src/cmd/compile/internal/gc/ssa.go

Lines changed: 86 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,9 @@ func (s *state) exit() *ssa.Block {
896896
addr := s.decladdrs[n]
897897
val := s.variable(n, n.Type)
898898
s.vars[&memVar] = s.newValue1A(ssa.OpVarDef, ssa.TypeMem, n, s.mem())
899-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, n.Type.Size(), addr, val, s.mem())
899+
store := s.newValue3I(ssa.OpStore, ssa.TypeMem, n.Type.Size(), addr, val, s.mem())
900+
store.Aux = n.Type
901+
s.vars[&memVar] = store
900902
// TODO: if val is ever spilled, we'd like to use the
901903
// PPARAMOUT slot for spilling it. That won't happen
902904
// currently.
@@ -2129,9 +2131,13 @@ func (s *state) append(n *Node, inplace bool) *ssa.Value {
21292131
s.vars[&memVar] = s.newValue1A(ssa.OpVarDef, ssa.TypeMem, sn, s.mem())
21302132
}
21312133
capaddr := s.newValue1I(ssa.OpOffPtr, ptrto(Types[TINT]), int64(array_cap), addr)
2132-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.IntSize, capaddr, r[2], s.mem())
2134+
store := s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.IntSize, capaddr, r[2], s.mem())
2135+
store.Aux = Types[TINT]
2136+
s.vars[&memVar] = store
21332137
if ssa.IsStackAddr(addr) {
2134-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, pt.Size(), addr, r[0], s.mem())
2138+
store := s.newValue3I(ssa.OpStore, ssa.TypeMem, pt.Size(), addr, r[0], s.mem())
2139+
store.Aux = pt
2140+
s.vars[&memVar] = store
21352141
} else {
21362142
s.insertWBstore(pt, addr, r[0], 0)
21372143
}
@@ -2154,7 +2160,9 @@ func (s *state) append(n *Node, inplace bool) *ssa.Value {
21542160
l = s.variable(&lenVar, Types[TINT]) // generates phi for len
21552161
nl = s.newValue2(s.ssaOp(OADD, Types[TINT]), Types[TINT], l, s.constInt(Types[TINT], nargs))
21562162
lenaddr := s.newValue1I(ssa.OpOffPtr, ptrto(Types[TINT]), int64(array_nel), addr)
2157-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.IntSize, lenaddr, nl, s.mem())
2163+
store := s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.IntSize, lenaddr, nl, s.mem())
2164+
store.Aux = Types[TINT]
2165+
s.vars[&memVar] = store
21582166
}
21592167

21602168
// Evaluate args
@@ -2188,13 +2196,17 @@ func (s *state) append(n *Node, inplace bool) *ssa.Value {
21882196
if haspointers(et) {
21892197
s.insertWBstore(et, addr, arg.v, 0)
21902198
} else {
2191-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, et.Size(), addr, arg.v, s.mem())
2199+
store := s.newValue3I(ssa.OpStore, ssa.TypeMem, et.Size(), addr, arg.v, s.mem())
2200+
store.Aux = et
2201+
s.vars[&memVar] = store
21922202
}
21932203
} else {
21942204
if haspointers(et) {
21952205
s.insertWBmove(et, addr, arg.v)
21962206
} else {
2197-
s.vars[&memVar] = s.newValue3I(ssa.OpMove, ssa.TypeMem, sizeAlignAuxInt(et), addr, arg.v, s.mem())
2207+
store := s.newValue3I(ssa.OpMove, ssa.TypeMem, sizeAlignAuxInt(et), addr, arg.v, s.mem())
2208+
store.Aux = et
2209+
s.vars[&memVar] = store
21982210
}
21992211
}
22002212
}
@@ -2354,10 +2366,14 @@ func (s *state) assign(left *Node, right *ssa.Value, wb, deref bool, skip skipMa
23542366
return
23552367
}
23562368
if right == nil {
2357-
s.vars[&memVar] = s.newValue2I(ssa.OpZero, ssa.TypeMem, sizeAlignAuxInt(t), addr, s.mem())
2369+
store := s.newValue2I(ssa.OpZero, ssa.TypeMem, sizeAlignAuxInt(t), addr, s.mem())
2370+
store.Aux = t
2371+
s.vars[&memVar] = store
23582372
return
23592373
}
2360-
s.vars[&memVar] = s.newValue3I(ssa.OpMove, ssa.TypeMem, sizeAlignAuxInt(t), addr, right, s.mem())
2374+
store := s.newValue3I(ssa.OpMove, ssa.TypeMem, sizeAlignAuxInt(t), addr, right, s.mem())
2375+
store.Aux = t
2376+
s.vars[&memVar] = store
23612377
return
23622378
}
23632379
// Treat as a store.
@@ -2378,7 +2394,9 @@ func (s *state) assign(left *Node, right *ssa.Value, wb, deref bool, skip skipMa
23782394
s.storeTypeScalars(t, addr, right, skip)
23792395
return
23802396
}
2381-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, t.Size(), addr, right, s.mem())
2397+
store := s.newValue3I(ssa.OpStore, ssa.TypeMem, t.Size(), addr, right, s.mem())
2398+
store.Aux = t
2399+
s.vars[&memVar] = store
23822400
}
23832401

23842402
// zeroVal returns the zero value for type t.
@@ -2954,7 +2972,9 @@ func (s *state) call(n *Node, k callKind) *ssa.Value {
29542972
argStart += int64(2 * Widthptr)
29552973
}
29562974
addr := s.constOffPtrSP(ptrto(Types[TUINTPTR]), argStart)
2957-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, int64(Widthptr), addr, rcvr, s.mem())
2975+
store := s.newValue3I(ssa.OpStore, ssa.TypeMem, int64(Widthptr), addr, rcvr, s.mem())
2976+
store.Aux = Types[TUINTPTR]
2977+
s.vars[&memVar] = store
29582978
}
29592979

29602980
// Defer/go args
@@ -2963,9 +2983,13 @@ func (s *state) call(n *Node, k callKind) *ssa.Value {
29632983
argStart := Ctxt.FixedFrameSize()
29642984
argsize := s.constInt32(Types[TUINT32], int32(stksize))
29652985
addr := s.constOffPtrSP(ptrto(Types[TUINT32]), argStart)
2966-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, 4, addr, argsize, s.mem())
2986+
store := s.newValue3I(ssa.OpStore, ssa.TypeMem, 4, addr, argsize, s.mem())
2987+
store.Aux = Types[TUINT32]
2988+
s.vars[&memVar] = store
29672989
addr = s.constOffPtrSP(ptrto(Types[TUINTPTR]), argStart+int64(Widthptr))
2968-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, int64(Widthptr), addr, closure, s.mem())
2990+
store = s.newValue3I(ssa.OpStore, ssa.TypeMem, int64(Widthptr), addr, closure, s.mem())
2991+
store.Aux = Types[TUINTPTR]
2992+
s.vars[&memVar] = store
29692993
stksize += 2 * int64(Widthptr)
29702994
}
29712995

@@ -3328,7 +3352,9 @@ func (s *state) rtcall(fn *obj.LSym, returns bool, results []*Type, args ...*ssa
33283352
off = Rnd(off, t.Alignment())
33293353
ptr := s.constOffPtrSP(t.PtrTo(), off)
33303354
size := t.Size()
3331-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, size, ptr, arg, s.mem())
3355+
store := s.newValue3I(ssa.OpStore, ssa.TypeMem, size, ptr, arg, s.mem())
3356+
store.Aux = t
3357+
s.vars[&memVar] = store
33323358
off += size
33333359
}
33343360
off = Rnd(off, int64(Widthptr))
@@ -3400,7 +3426,8 @@ func (s *state) insertWBmove(t *Type, left, right *ssa.Value) {
34003426
} else {
34013427
val = s.newValue3I(ssa.OpMoveWB, ssa.TypeMem, sizeAlignAuxInt(t), left, right, s.mem())
34023428
}
3403-
val.Aux = &ssa.ExternSymbol{Typ: Types[TUINTPTR], Sym: Linksym(typenamesym(t))}
3429+
//val.Aux = &ssa.ExternSymbol{Typ: Types[TUINTPTR], Sym: Linksym(typenamesym(t))}
3430+
val.Aux = t
34043431
s.vars[&memVar] = val
34053432
}
34063433

@@ -3433,7 +3460,9 @@ func (s *state) insertWBstore(t *Type, left, right *ssa.Value, skip skipMask) {
34333460
func (s *state) storeTypeScalars(t *Type, left, right *ssa.Value, skip skipMask) {
34343461
switch {
34353462
case t.IsBoolean() || t.IsInteger() || t.IsFloat() || t.IsComplex():
3436-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, t.Size(), left, right, s.mem())
3463+
store := s.newValue3I(ssa.OpStore, ssa.TypeMem, t.Size(), left, right, s.mem())
3464+
store.Aux = t
3465+
s.vars[&memVar] = store
34373466
case t.IsPtrShaped():
34383467
// no scalar fields.
34393468
case t.IsString():
@@ -3442,22 +3471,30 @@ func (s *state) storeTypeScalars(t *Type, left, right *ssa.Value, skip skipMask)
34423471
}
34433472
len := s.newValue1(ssa.OpStringLen, Types[TINT], right)
34443473
lenAddr := s.newValue1I(ssa.OpOffPtr, ptrto(Types[TINT]), s.config.IntSize, left)
3445-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.IntSize, lenAddr, len, s.mem())
3474+
store := s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.IntSize, lenAddr, len, s.mem())
3475+
store.Aux = Types[TINT]
3476+
s.vars[&memVar] = store
34463477
case t.IsSlice():
34473478
if skip&skipLen == 0 {
34483479
len := s.newValue1(ssa.OpSliceLen, Types[TINT], right)
34493480
lenAddr := s.newValue1I(ssa.OpOffPtr, ptrto(Types[TINT]), s.config.IntSize, left)
3450-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.IntSize, lenAddr, len, s.mem())
3481+
store := s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.IntSize, lenAddr, len, s.mem())
3482+
store.Aux = Types[TINT]
3483+
s.vars[&memVar] = store
34513484
}
34523485
if skip&skipCap == 0 {
34533486
cap := s.newValue1(ssa.OpSliceCap, Types[TINT], right)
34543487
capAddr := s.newValue1I(ssa.OpOffPtr, ptrto(Types[TINT]), 2*s.config.IntSize, left)
3455-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.IntSize, capAddr, cap, s.mem())
3488+
store := s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.IntSize, capAddr, cap, s.mem())
3489+
store.Aux = Types[TINT]
3490+
s.vars[&memVar] = store
34563491
}
34573492
case t.IsInterface():
34583493
// itab field doesn't need a write barrier (even though it is a pointer).
34593494
itab := s.newValue1(ssa.OpITab, ptrto(Types[TUINT8]), right)
3460-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.IntSize, left, itab, s.mem())
3495+
store := s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.IntSize, left, itab, s.mem())
3496+
store.Aux = Types[TUINTPTR]
3497+
s.vars[&memVar] = store
34613498
case t.IsStruct():
34623499
n := t.NumFields()
34633500
for i := 0; i < n; i++ {
@@ -3479,18 +3516,26 @@ func (s *state) storeTypeScalars(t *Type, left, right *ssa.Value, skip skipMask)
34793516
func (s *state) storeTypePtrs(t *Type, left, right *ssa.Value) {
34803517
switch {
34813518
case t.IsPtrShaped():
3482-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.PtrSize, left, right, s.mem())
3519+
store := s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.PtrSize, left, right, s.mem())
3520+
store.Aux = t
3521+
s.vars[&memVar] = store
34833522
case t.IsString():
34843523
ptr := s.newValue1(ssa.OpStringPtr, ptrto(Types[TUINT8]), right)
3485-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.PtrSize, left, ptr, s.mem())
3524+
store := s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.PtrSize, left, ptr, s.mem())
3525+
store.Aux = ptrto(Types[TUINT8])
3526+
s.vars[&memVar] = store
34863527
case t.IsSlice():
34873528
ptr := s.newValue1(ssa.OpSlicePtr, ptrto(Types[TUINT8]), right)
3488-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.PtrSize, left, ptr, s.mem())
3529+
store := s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.PtrSize, left, ptr, s.mem())
3530+
store.Aux = ptrto(Types[TUINT8])
3531+
s.vars[&memVar] = store
34893532
case t.IsInterface():
34903533
// itab field is treated as a scalar.
34913534
idata := s.newValue1(ssa.OpIData, ptrto(Types[TUINT8]), right)
34923535
idataAddr := s.newValue1I(ssa.OpOffPtr, ptrto(ptrto(Types[TUINT8])), s.config.PtrSize, left)
3493-
s.vars[&memVar] = s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.PtrSize, idataAddr, idata, s.mem())
3536+
store := s.newValue3I(ssa.OpStore, ssa.TypeMem, s.config.PtrSize, idataAddr, idata, s.mem())
3537+
store.Aux = ptrto(Types[TUINT8])
3538+
s.vars[&memVar] = store
34943539
case t.IsStruct():
34953540
n := t.NumFields()
34963541
for i := 0; i < n; i++ {
@@ -3515,18 +3560,26 @@ func (s *state) storeTypePtrs(t *Type, left, right *ssa.Value) {
35153560
func (s *state) storeTypePtrsWB(t *Type, left, right *ssa.Value) {
35163561
switch {
35173562
case t.IsPtrShaped():
3518-
s.vars[&memVar] = s.newValue3I(ssa.OpStoreWB, ssa.TypeMem, s.config.PtrSize, left, right, s.mem())
3563+
store := s.newValue3I(ssa.OpStoreWB, ssa.TypeMem, s.config.PtrSize, left, right, s.mem())
3564+
store.Aux = t
3565+
s.vars[&memVar] = store
35193566
case t.IsString():
35203567
ptr := s.newValue1(ssa.OpStringPtr, ptrto(Types[TUINT8]), right)
3521-
s.vars[&memVar] = s.newValue3I(ssa.OpStoreWB, ssa.TypeMem, s.config.PtrSize, left, ptr, s.mem())
3568+
store := s.newValue3I(ssa.OpStoreWB, ssa.TypeMem, s.config.PtrSize, left, ptr, s.mem())
3569+
store.Aux = ptrto(Types[TUINT8])
3570+
s.vars[&memVar] = store
35223571
case t.IsSlice():
35233572
ptr := s.newValue1(ssa.OpSlicePtr, ptrto(Types[TUINT8]), right)
3524-
s.vars[&memVar] = s.newValue3I(ssa.OpStoreWB, ssa.TypeMem, s.config.PtrSize, left, ptr, s.mem())
3573+
store := s.newValue3I(ssa.OpStoreWB, ssa.TypeMem, s.config.PtrSize, left, ptr, s.mem())
3574+
store.Aux = ptrto(Types[TUINT8])
3575+
s.vars[&memVar] = store
35253576
case t.IsInterface():
35263577
// itab field is treated as a scalar.
35273578
idata := s.newValue1(ssa.OpIData, ptrto(Types[TUINT8]), right)
35283579
idataAddr := s.newValue1I(ssa.OpOffPtr, ptrto(ptrto(Types[TUINT8])), s.config.PtrSize, left)
3529-
s.vars[&memVar] = s.newValue3I(ssa.OpStoreWB, ssa.TypeMem, s.config.PtrSize, idataAddr, idata, s.mem())
3580+
store := s.newValue3I(ssa.OpStoreWB, ssa.TypeMem, s.config.PtrSize, idataAddr, idata, s.mem())
3581+
store.Aux = ptrto(Types[TUINT8])
3582+
s.vars[&memVar] = store
35303583
case t.IsStruct():
35313584
n := t.NumFields()
35323585
for i := 0; i < n; i++ {
@@ -4127,7 +4180,9 @@ func (s *state) dottype(n *Node, commaok bool) (res, resok *ssa.Value) {
41274180
}
41284181
} else {
41294182
p := s.newValue1(ssa.OpIData, ptrto(n.Type), iface)
4130-
s.vars[&memVar] = s.newValue3I(ssa.OpMove, ssa.TypeMem, sizeAlignAuxInt(n.Type), addr, p, s.mem())
4183+
store := s.newValue3I(ssa.OpMove, ssa.TypeMem, sizeAlignAuxInt(n.Type), addr, p, s.mem())
4184+
store.Aux = n.Type
4185+
s.vars[&memVar] = store
41314186
}
41324187
s.vars[&okVar] = s.constBool(true)
41334188
s.endBlock()
@@ -4138,7 +4193,9 @@ func (s *state) dottype(n *Node, commaok bool) (res, resok *ssa.Value) {
41384193
if tmp == nil {
41394194
s.vars[valVar] = s.zeroVal(n.Type)
41404195
} else {
4141-
s.vars[&memVar] = s.newValue2I(ssa.OpZero, ssa.TypeMem, sizeAlignAuxInt(n.Type), addr, s.mem())
4196+
store := s.newValue2I(ssa.OpZero, ssa.TypeMem, sizeAlignAuxInt(n.Type), addr, s.mem())
4197+
store.Aux = n.Type
4198+
s.vars[&memVar] = store
41424199
}
41434200
s.vars[&okVar] = s.constBool(false)
41444201
s.endBlock()

src/cmd/compile/internal/gc/type.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ package gc
1111

1212
import (
1313
"cmd/compile/internal/ssa"
14+
"cmd/internal/obj"
1415
"cmd/internal/src"
1516
"fmt"
1617
)
@@ -1279,3 +1280,17 @@ func (t *Type) IsUntyped() bool {
12791280
}
12801281
return false
12811282
}
1283+
1284+
// HasPointer returns whether t contains heap pointer.
1285+
// This is used for write barrier insertion, so we ignore
1286+
// pointers to go:notinheap types.
1287+
func (t *Type) HasPointer() bool {
1288+
if t.IsPtr() && t.Elem().NotInHeap() {
1289+
return false
1290+
}
1291+
return haspointers(t)
1292+
}
1293+
1294+
func (t *Type) Symbol() *obj.LSym {
1295+
return Linksym(typenamesym(t))
1296+
}

src/cmd/compile/internal/ssa/gen/dec.rules

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
mem)
2020
)
2121
(Store [8] dst (ComplexMake real imag) mem) ->
22-
(Store [4]
22+
(Store [4] {config.fe.TypeFloat32()}
2323
(OffPtr <config.fe.TypeFloat32().PtrTo()> [4] dst)
2424
imag
25-
(Store [4] dst real mem))
25+
(Store [4] {config.fe.TypeFloat32()} dst real mem))
2626
(Load <t> ptr mem) && t.IsComplex() && t.Size() == 16 ->
2727
(ComplexMake
2828
(Load <config.fe.TypeFloat64()> ptr mem)
@@ -31,10 +31,10 @@
3131
mem)
3232
)
3333
(Store [16] dst (ComplexMake real imag) mem) ->
34-
(Store [8]
34+
(Store [8] {config.fe.TypeFloat64()}
3535
(OffPtr <config.fe.TypeFloat64().PtrTo()> [8] dst)
3636
imag
37-
(Store [8] dst real mem))
37+
(Store [8] {config.fe.TypeFloat64()} dst real mem))
3838

3939
// string ops
4040
(StringPtr (StringMake ptr _)) -> ptr
@@ -47,10 +47,10 @@
4747
(OffPtr <config.fe.TypeInt().PtrTo()> [config.PtrSize] ptr)
4848
mem))
4949
(Store [2*config.PtrSize] dst (StringMake ptr len) mem) ->
50-
(Store [config.PtrSize]
50+
(Store [config.PtrSize] {config.fe.TypeInt()}
5151
(OffPtr <config.fe.TypeInt().PtrTo()> [config.PtrSize] dst)
5252
len
53-
(Store [config.PtrSize] dst ptr mem))
53+
(Store [config.PtrSize] {config.fe.TypeBytePtr()} dst ptr mem))
5454

5555
// slice ops
5656
(SlicePtr (SliceMake ptr _ _ )) -> ptr
@@ -67,13 +67,13 @@
6767
(OffPtr <config.fe.TypeInt().PtrTo()> [2*config.PtrSize] ptr)
6868
mem))
6969
(Store [3*config.PtrSize] dst (SliceMake ptr len cap) mem) ->
70-
(Store [config.PtrSize]
70+
(Store [config.PtrSize] {config.fe.TypeInt()}
7171
(OffPtr <config.fe.TypeInt().PtrTo()> [2*config.PtrSize] dst)
7272
cap
73-
(Store [config.PtrSize]
73+
(Store [config.PtrSize] {config.fe.TypeInt()}
7474
(OffPtr <config.fe.TypeInt().PtrTo()> [config.PtrSize] dst)
7575
len
76-
(Store [config.PtrSize] dst ptr mem)))
76+
(Store [config.PtrSize] {config.fe.TypeBytePtr()} dst ptr mem)))
7777

7878
// interface ops
7979
(ITab (IMake itab _)) -> itab
@@ -86,7 +86,7 @@
8686
(OffPtr <config.fe.TypeBytePtr().PtrTo()> [config.PtrSize] ptr)
8787
mem))
8888
(Store [2*config.PtrSize] dst (IMake itab data) mem) ->
89-
(Store [config.PtrSize]
89+
(Store [config.PtrSize] {config.fe.TypeBytePtr()}
9090
(OffPtr <config.fe.TypeBytePtr().PtrTo()> [config.PtrSize] dst)
9191
data
92-
(Store [config.PtrSize] dst itab mem))
92+
(Store [config.PtrSize] {config.fe.TypeUintptr()} dst itab mem))

src/cmd/compile/internal/ssa/gen/dec64.rules

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@
3131
(Load <config.fe.TypeUInt32()> (OffPtr <config.fe.TypeUInt32().PtrTo()> [4] ptr) mem))
3232

3333
(Store [8] dst (Int64Make hi lo) mem) && !config.BigEndian ->
34-
(Store [4]
34+
(Store [4] {hi.Type}
3535
(OffPtr <hi.Type.PtrTo()> [4] dst)
3636
hi
37-
(Store [4] dst lo mem))
37+
(Store [4] {lo.Type} dst lo mem))
3838

3939
(Store [8] dst (Int64Make hi lo) mem) && config.BigEndian ->
40-
(Store [4]
40+
(Store [4] {lo.Type}
4141
(OffPtr <lo.Type.PtrTo()> [4] dst)
4242
lo
43-
(Store [4] dst hi mem))
43+
(Store [4] {hi.Type} dst hi mem))
4444

4545
(Arg {n} [off]) && is64BitInt(v.Type) && !config.BigEndian && v.Type.IsSigned() ->
4646
(Int64Make

0 commit comments

Comments
 (0)