Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: incorrect comparison folding #41872

Closed
randall77 opened this issue Oct 8, 2020 · 1 comment
Closed

cmd/compile: incorrect comparison folding #41872

randall77 opened this issue Oct 8, 2020 · 1 comment

Comments

@randall77
Copy link
Contributor

@randall77 randall77 commented Oct 8, 2020

package main

//go:noinline
func f(x int32) bool {
	return byte(x&0xc0) == 64
}

func main() {
	if !f(64) {
		panic("wanted true, got false")
	}
}

Shouldn't panic. It does at tip.

@gopherbot
Copy link

@gopherbot gopherbot commented Oct 8, 2020

Change https://golang.org/cl/260701 mentions this issue: cmd/compile: fix incorrect comparison folding

Loading

@dmitshur dmitshur added this to the Go1.16 milestone Oct 8, 2020
@gopherbot gopherbot closed this in a4b95cd Oct 8, 2020
@golang golang locked and limited conversation to collaborators Oct 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants