https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102662

            Bug ID: 102662
           Summary: [12 Regression] ICE in validate, at
                    analyzer/constraint-manager.cc:581
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-checking, ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++-12.0.0-alpha20211003 snapshot (g:d91056851c5c60f226e3192fb955d018b53eb66f)
ICEs when compiling the following piece of C code w/ -fanalyzer -fstrict-enums:

enum OpCode {
  OP_MOVE,
  OP_LOADK,
  OP_LOADBOOL,
  OP_LOADNIL,
  OP_GETUPVAL,
  OP_SETUPVAL
};

enum OpArg {
  OpArgN,
  OpArgU,
  OpArgR,
  OpArgK
};

void
symbexec_lastpc (enum OpCode symbexec_lastpc_op, enum OpArg luaP_opmodes)
{
  switch (luaP_opmodes)
    {
    case OpArgN:
    case OpArgK:
      {
        switch (symbexec_lastpc_op)
          {
          case OP_LOADNIL:
          case OP_SETUPVAL:
            break;
          default:
            break;
          }
      }
    default:
      break;
    }
}

% g++-12.0.0 -fanalyzer -fstrict-enums -c c5smosbk.c
during IPA pass: analyzer
In function 'void symbexec_lastpc(OpCode, OpArg)':
cc1plus: internal compiler error: in validate, at
analyzer/constraint-manager.cc:581
0x91ca2d ana::bounded_ranges::validate() const
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211003/work/gcc-12-20211003/gcc/analyzer/constraint-manager.cc:581
0x1f62159
ana::bounded_ranges_manager::get_or_create_union(vec<ana::bounded_ranges
const*, va_heap, vl_ptr> const&)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211003/work/gcc-12-20211003/gcc/analyzer/constraint-manager.cc:760
0x1f663ea ana::bounded_ranges_manager::make_case_label_ranges(gswitch const*,
tree_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211003/work/gcc-12-20211003/gcc/analyzer/constraint-manager.cc:937
0x1f6650d
ana::bounded_ranges_manager::create_ranges_for_switch(ana::switch_cfg_superedge
const&, gswitch const*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211003/work/gcc-12-20211003/gcc/analyzer/constraint-manager.cc:889
0x1f666ce
ana::bounded_ranges_manager::get_or_create_ranges_for_switch(ana::switch_cfg_superedge
const*, gswitch const*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211003/work/gcc-12-20211003/gcc/analyzer/constraint-manager.cc:867
0x1539ec8
ana::region_model::apply_constraints_for_gswitch(ana::switch_cfg_superedge
const&, gswitch const*, ana::region_model_context*, ana::rejected_constraint**)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211003/work/gcc-12-20211003/gcc/analyzer/region-model.cc:3341
0x152cab1 ana::program_state::on_edge(ana::exploded_graph&,
ana::exploded_node*, ana::superedge const*, ana::uncertainty_t*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211003/work/gcc-12-20211003/gcc/analyzer/program-state.cc:1018
0x151a9aa ana::exploded_graph::process_node(ana::exploded_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211003/work/gcc-12-20211003/gcc/analyzer/engine.cc:3575
0x151befa ana::exploded_graph::process_worklist()
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211003/work/gcc-12-20211003/gcc/analyzer/engine.cc:2788
0x151e395 ana::impl_run_checkers(ana::logger*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211003/work/gcc-12-20211003/gcc/analyzer/engine.cc:5364
0x151f240 ana::run_checkers()
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211003/work/gcc-12-20211003/gcc/analyzer/engine.cc:5435
0x150efe8 execute
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211003/work/gcc-12-20211003/gcc/analyzer/analyzer-pass.cc:87

Reply via email to