From 620a3c0596a2c0dd04964c3655e4f631fb85c0bb Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Wed, 15 Dec 2021 15:59:43 -0800 Subject: [PATCH] cmd/compile: use bool->uint8 op instead of copy Just a cleanup to make sure that generic SSA is properly typed. Change-Id: Ie75fa972ae4e5fdaca535968769bca36044191c9 Reviewed-on: https://go-review.googlesource.com/c/go/+/372574 Trust: Keith Randall Run-TryBot: Keith Randall TryBot-Result: Gopher Robot Reviewed-by: Cherry Mui --- src/cmd/compile/internal/ssagen/ssa.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/ssagen/ssa.go b/src/cmd/compile/internal/ssagen/ssa.go index 364e0c8197..60747d93ca 100644 --- a/src/cmd/compile/internal/ssagen/ssa.go +++ b/src/cmd/compile/internal/ssagen/ssa.go @@ -2382,7 +2382,7 @@ func (s *state) ssaShiftOp(op ir.Op, t *types.Type, u *types.Type) ssa.Op { func (s *state) conv(n ir.Node, v *ssa.Value, ft, tt *types.Type) *ssa.Value { if ft.IsBoolean() && tt.IsKind(types.TUINT8) { // Bool -> uint8 is generated internally when indexing into runtime.staticbyte. - return s.newValue1(ssa.OpCopy, tt, v) + return s.newValue1(ssa.OpCvtBoolToUint8, tt, v) } if ft.IsInteger() && tt.IsInteger() { var op ssa.Op -- 2.50.0