cfallin opened PR #4243 from fix-atomic-cas
to main
:
The current lowering helper for
cmpxchg
returns the literal RealReg
rax
as its result. However, this breaks a number of invariants, and
eventually causes a regalloc panic if used as a blockparam arg (pinned
vregs cannot be used in this way).In general we have to return regular vregs, not a RealReg, as results of
instructions during lowering. However #4223 added a helper for
x64_cmpxchg
that returns a literalrax
.Fortunately we can do the right thing here by just giving a fresh vreg
to the instruction; the regalloc constraints mean that this vreg is
constrained torax
at the instruction (at its def/late point), so the
generator of the instruction need not worry aboutrax
here.Fixes second issue reported by @bjorn3 in #4234.
cc/fyi @abrown, but I missed this in review (sorry!).
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
cfallin requested abrown for a review on PR #4243.
cfallin requested fitzgen for a review on PR #4243.
abrown submitted PR review.
abrown merged PR #4243.
Last updated: Dec 23 2024 at 12:05 UTC