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.16 backport] #50682

gopherbot opened this issue Jan 19, 2022 · 3 comments


Copy link

@gopherbot gopherbot commented Jan 19, 2022

@bcmills requested issue #50671 to be considered for backport to the next 1.16 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.16.14 milestone Jan 19, 2022
@toothrot toothrot added the CherryPickApproved label Jan 19, 2022
Copy link

@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
Copy link

@gopherbot gopherbot commented Jan 19, 2022

Change mentions this issue: [release-branch.go1.16] cmd/compile: don't elide extension for LoadReg to FP register on MIPS64

Copy link

@gopherbot gopherbot commented Feb 7, 2022

Closed by merging fcd482a to release-branch.go1.16.

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

Updates #50671.
Fixes #50682.

Change-Id: Id8991df78d5acdecd3fd6138c558428cbd5f6ba3
Trust: Cherry Mui <>
Run-TryBot: Cherry Mui <>
TryBot-Result: Gopher Robot <>
Reviewed-by: David Chase <>
(cherry picked from commit d93ff73)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants