/ go Public
cmd/compile: optimize xor to complement #39710
Issues related to the Go compiler and/or runtime.
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
What did you do?
Tried to flip bits in a large section of a bitmap using
^= ^uint64(0)in a loop.
What did you expect to see?
The compiler treats this as a bitwise complement operation.
What did you see instead?
The compiler emits an xor against a constant, and treats it differently than a bitwise complement.
If I understand correctly, this could be solved by adding the following rule to
The text was updated successfully, but these errors were encountered: