-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.Performancecompiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Milestone
Description
Tested on 1.15.3 and tip.
Foo contains an unnecessary panicshift call, whereas Bar does not:
func Foo(x int) byte {
if x >= 0 {
return byte(1) << (x % 8)
}
return 0
}
func Bar(x uint) byte {
return byte(1) << (x % 8)
}godbolt link: https://godbolt.org/z/qhTqYM
odeke-em and maxpoletaev
Metadata
Metadata
Assignees
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.Performancecompiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.