10000 compiler: Fix incorrect aliasing in matching tuples by lucioleKi · Pull Request #9833 · erlang/otp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

compiler: Fix incorrect aliasing in matching tuples #9833

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

Conversation

lucioleKi
Copy link
Contributor

Fix #9813. This is a safe but pessimistic fix. Disabled test cases and optimizations will be enabled again in a future commit.

@lucioleKi lucioleKi requested a review from jhogberg May 13, 2025 09:04
@lucioleKi lucioleKi self-assigned this May 13, 2025
@lucioleKi lucioleKi added the team:VM Assigned to OTP team VM label May 13, 2025
Copy link
Contributor
github-actions bot commented May 13, 2025

CT Test Results

    2 files    333 suites   8m 22s ⏱️
  847 tests   843 ✅ 4 💤 0 ❌
5 602 runs  5 598 ✅ 4 💤 0 ❌

Results for commit 0eb08d0.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

transformable1(L, start) ->
%ssa% (_, Arg1) when post_ssa_opt ->
Copy link
Contributor
@frej frej May 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

%% You should use %ssa% xfail (_, Arg1) when post_ssa_opt -> and not just comment them out in bulk, that way you'll notice all the relevant test cases when the optimization is re-enabled .

@lucioleKi lucioleKi added the testing currently being tested, tag is used by OTP internal CI label May 13, 2025
Fix erlang#9813. This is a safe but
pessimistic fix. Disabled test cases and optimizations will be enabled
again in a future commit.
@lucioleKi lucioleKi force-pushed the isabell/compiler/alias-fix/GH-9813/OTP-19633 branch from 7cd373c to 0eb08d0 Compare May 13, 2025 09:42
frej added a commit to frej/otp that referenced this pull request May 13, 2025
Previously all bifs selected by the erl_internal:comp_op/2 predicate
was erroneously considered safe from an aliasing perspective. This is
not true as they, depending on the argument types, could access
internal elements of a term which has been destructively updated. As
this makes the destructive update visible, this is illegal and should
not happen.

To fix this problem, we have to consider all comparison bifs as
aliasing operations, thus avoiding the problem described
above. Unfortunately this is a very pessimistic solution, and by
making use of type information we can avoid forced aliasing when it
can be determined that the comparison bif will be reduced to a simple
tag test.

This is less conservative fix than the one presented in erlang#9833.

Co-authored-by: Isabell H. <isabell@erlang.org>
Closes erlang#9813.
frej added a commit to frej/otp that referenced this pull request May 13, 2025
Previously all bifs selected by the erl_internal:comp_op/2 predicate
was erroneously considered safe from an aliasing perspective. This is
not true as they, depending on the argument types, could access
internal elements of a term which has been destructively updated. As
this makes the destructive update visible, this is illegal and should
not happen.

To fix this problem, we have to consider all comparison bifs as
aliasing operations, thus avoiding the problem described
above. Unfortunately this is a very pessimistic solution, and by
making use of type information we can avoid forced aliasing when it
can be determined that the comparison bif will be reduced to a simple
tag test.

This is less conservative fix than the one presented in erlang#9833.

Co-authored-by: Isabell H. <isabell@erlang.org>
Closes erlang#9813.
@lucioleKi lucioleKi closed this May 13, 2025
lucioleKi added a commit that referenced this pull request May 14, 2025
compiler: Fix alias analysis bug (less conservative version of #9833)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potential compiler bug with OTP-28 release candidates
2 participants
0