Skip to content

Commit

Permalink
cmd/compile: use bool->uint8 op instead of copy
Browse files Browse the repository at this point in the history
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 <[email protected]>
Run-TryBot: Keith Randall <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
  • Loading branch information
randall77 committed Mar 1, 2022
1 parent 510ad45 commit 620a3c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/ssagen/ssa.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 620a3c0

Please sign in to comment.