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: MOVWreg missing sign-extension following a Copy from a floating-point LoadReg [1.17 backport] #50683

Closed
gopherbot opened this issue Jan 19, 2022 · 3 comments
Labels
CherryPickApproved
Milestone

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Jan 19, 2022

@bcmills requested issue #50671 to be considered for backport to the next 1.17 minor release.

@gopherbot, please backport to Go 1.16 and Go 1.17. This is a compiler bug that causes subtle run-time data corruption; it is hard to predict which code might be affected, and the corrupted paths might not be triggered by tests, but it appears to cause a nonzero rate of failures in the Go builders. The fix is small and MIPS-specific, so backporting it seems low-risk.

@gopherbot gopherbot added the CherryPickCandidate label Jan 19, 2022
@gopherbot gopherbot added this to the Go1.17.7 milestone Jan 19, 2022
@toothrot toothrot added the CherryPickApproved label Jan 19, 2022
@toothrot
Copy link
Contributor

@toothrot toothrot commented Jan 19, 2022

This generates the wrong code and the fix is low risk. Approved.

@gopherbot gopherbot removed the CherryPickCandidate label Jan 19, 2022
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Jan 19, 2022

Change https://golang.org/cl/379514 mentions this issue: [release-branch.go1.17] cmd/compile: don't elide extension for LoadReg to FP register on MIPS64

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Feb 7, 2022

Closed by merging 1651426 to release-branch.go1.17.

gopherbot pushed a commit that referenced this issue Feb 7, 2022
…g to FP register on MIPS64

For an extension operation like MOVWreg, if the operand is already
extended, we optimize the second extension out. Usually a LoadReg
of a proper type would come already extended, as a MOVW/MOVWU etc.
instruction does. But for a LoadReg to a floating point register,
the instruction does not do the extension. So we cannot elide the
extension.

Updates #50671.
Fixes #50683.

Change-Id: Id8991df78d5acdecd3fd6138c558428cbd5f6ba3
Reviewed-on: https://go-review.googlesource.com/c/go/+/379236
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
(cherry picked from commit d93ff73)
Reviewed-on: https://go-review.googlesource.com/c/go/+/379514
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved
Projects
None yet
Development

No branches or pull requests

2 participants