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

[erlc] "internal consistency check failed" with some optimizations disabled #6962

Closed
RobinMorisset opened this issue Mar 2, 2023 · 1 comment · Fixed by #6964
Closed
Assignees
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM

Comments

@RobinMorisset
Copy link
Contributor

Describe the bug
Running erlc with +no_copt +no_bool_opt +no_ssa_opt on the following code:

f() ->
    [0 || (X = (true or (X = is_port(node()))))].

results in the following error:

type_conflict:1: function f/0+10:
  Internal consistency check failed - please report this bug.
  Instruction: {select_val,{x,1},
                           {f,7},
                           {list,[{atom,false},{f,8},{atom,true},{f,9}]}}
  Error:       {type_conflict,{t_atom,[false]},{t_atom,[false]}}:

I have not managed to reproduce this bug with default options for erlc, but I am reporting it anyway in case it is revealing a more serious problem.

Expected behavior
From the name of the options, I expected them to only affect optimizations, and not transformations that are required for correctness.

Affected versions

@RobinMorisset RobinMorisset added the bug Issue is reported as a bug label Mar 2, 2023
@jhogberg jhogberg self-assigned this Mar 2, 2023
@jhogberg jhogberg added the team:VM Assigned to OTP team VM label Mar 2, 2023
@jhogberg
Copy link
Contributor

jhogberg commented Mar 2, 2023

Thanks for your report, the type inference in the validator was a bit weaker than it should have been. I've fixed it in #6964

jhogberg added a commit that referenced this issue Mar 6, 2023
…nce/GH-6962

beam_validator: Fix inference on singleton types in registers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants