-
Notifications
You must be signed in to change notification settings - Fork 3k
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
compiler: Fix incorrect aliasing in matching tuples #9833
Conversation
CT Test Results 2 files 333 suites 8m 22s ⏱️ 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 -> |
There was a problem hiding this comment.
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 .
Fix erlang#9813. This is a safe but pessimistic fix. Disabled test cases and optimizations will be enabled again in a future commit.
7cd373c
to
0eb08d0
Compare
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.
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.
compiler: Fix alias analysis bug (less conservative version of #9833)
Fix #9813. This is a safe but pessimistic fix. Disabled test cases and optimizations will be enabled again in a future commit.