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: code motion doesn't recognize some loads #8641
Labels
Milestone
Comments
The bug was seen by changing deferproc to return its result on the stack. The memory access was the load of the result, and it was being reordered early because it happened right after the return. That code never made it into the repo. Because we left deferproc returning the result in a register, the code after the return does an immediate compare of the register + conditional jump before any memory access, so the memory accesses cannot be reordered ahead of the conditional jump. |
gopherbot
pushed a commit
that referenced
this issue
Dec 23, 2014
Calls to goproc/deferproc used to push & pop two extra arguments, the argument size and the function to call. Now, we allocate space for those arguments in the outargs section so we don't have to modify the SP. Defers now use the stack pointer (instead of the argument pointer) to identify which frame they are associated with. A followon CL might simplify funcspdelta and some of the stack walking code. Fixes issue #8641 Change-Id: I835ec2f42f0392c5dec7cb0fe6bba6f2aed1dad8 Reviewed-on: https://go-review.googlesource.com/1601 Reviewed-by: Russ Cox <rsc@golang.org>
This is fixed by khr's change not to do funny stack adjustments around newproc and deferproc. |
rsc
changed the title
cmd/5g: code motion doesn't recognize some loads
cmd/compile: code motion doesn't recognize some loads
Jun 8, 2015
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: