What version of Go are you using (go version)?
$ go version
go version devel +c82e7e7 Tue Jun 18 22:21:45 2019 +0000 linux/amd64
Does this issue reproduce with the latest release?
Yes.
What did you do?
I inspected the assembly code generated for the following functions:
func f1(b bool) bool {
return b && !b
}
func f2(b bool) bool {
return b || !b
}
What did you expect to see?
I expected them to be compiled to a simple return: false in the first case, true in the second.
What did you see instead?
Instead, boolean operations are performed on the variable b.
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
Yes.
What did you do?
I inspected the assembly code generated for the following functions:
What did you expect to see?
I expected them to be compiled to a simple return: false in the first case, true in the second.
What did you see instead?
Instead, boolean operations are performed on the variable
b.