Skip to content

[erlc] internal error in sub pass ssa_opt_bc_size #6468

Closed
@RobinMorisset

Description

@RobinMorisset
-module(opt_literal_false).
-compile([export_all]).

f(X) ->
    <<
        X
     || _ <- X,
        case is_port(X) of
            Y ->
                (#{
                    ((not Y) andalso
                        <<Y:(Y andalso X)>>) := Y
                } = X)
        end
    >>.

causes erlc to crash with the following error message:

Function: f/1
Sub pass ssa_opt_bc_size
minimized/opt_literal_false.erl: internal error in pass beam_ssa_opt:
exception error: no case clause matching {b_literal,false}
  in function  beam_ssa_bc_size:update_successors/3 (beam_ssa_bc_size.erl, line 239)
  in call from beam_ssa_bc_size:calc_size/2 (beam_ssa_bc_size.erl, line 204)
  in call from beam_ssa_bc_size:call_size_func/2 (beam_ssa_bc_size.erl, line 158)
  in call from beam_ssa_bc_size:opt_writable/7 (beam_ssa_bc_size.erl, line 99)
  in call from beam_ssa_bc_size:opt_blks/6 (beam_ssa_bc_size.erl, line 75)
  in call from beam_ssa_bc_size:opt_function/2 (beam_ssa_bc_size.erl, line 58)
  in call from beam_ssa_bc_size:opt/2 (beam_ssa_bc_size.erl, line 51)
  in call from beam_ssa_opt:'-module_passes/1-anonymous-2-'/1 (beam_ssa_opt.erl, line 254)

This affects master. Cherry-picking 55eae53 and 28fce1f does not fix the issue.

Metadata

Metadata

Assignees

Labels

bugIssue is reported as a bugteam:VMAssigned to OTP team VM

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions