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

            Bug ID: 93378
           Summary: ICE in as_a, at is-a.h:197
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: 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: ---

gcc-10.0.0-alpha20200119 snapshot (g:3684bbb022cd75da55e1457673f269980aa12cdf)
ICEs when compiling the following testcase, reduced from
gcc/testsuite/gcc.dg/torture/pr48542.c, w/ -O1 -fanalyzer -g:

typedef long int jmp_buf[1];
jmp_buf x4;

int
_setjmp (jmp_buf);

void
longjmp (jmp_buf, int);

int
la (void)
{
  if (_setjmp (x4) != 0)
    return 0;

  longjmp (x4, 1);
}

% gcc-10.0.0-alpha20200119 -O1 -fanalyzer -g -c ysvegkml.c
during IPA pass: analyzer
ysvegkml.c: In function 'la':
ysvegkml.c:16:3: internal compiler error: in as_a, at is-a.h:197
   16 |   longjmp (x4, 1);
      |   ^~~~~~~
0x718f5d gcall const* as_a<gcall const*, gimple const>(gimple const*)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200119/work/gcc-10-20200119/gcc/is-a.h:197
0x7194ca gcall const* as_a<gcall const*, gimple const>(gimple const*)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200119/work/gcc-10-20200119/gcc/analyzer/engine.cc:1187
0x7194ca rewind_info_t::get_setjmp_call() const
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200119/work/gcc-10-20200119/gcc/analyzer/exploded-graph.h:337
0x7194ca exploded_node::on_longjmp(exploded_graph&, gcall const*,
program_state*, region_model_context*) const
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200119/work/gcc-10-20200119/gcc/analyzer/engine.cc:1175
0x10e1ebc exploded_node::on_stmt(exploded_graph&, supernode const*, gimple
const*, program_state*, state_change*) const
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200119/work/gcc-10-20200119/gcc/analyzer/engine.cc:1002
0x10e24d1 exploded_graph::process_node(exploded_node*)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200119/work/gcc-10-20200119/gcc/analyzer/engine.cc:2433
0x10e29b2 exploded_graph::process_worklist()
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200119/work/gcc-10-20200119/gcc/analyzer/engine.cc:2253
0x10e3039 impl_run_checkers(logger*)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200119/work/gcc-10-20200119/gcc/analyzer/engine.cc:3570
0x10e3ad3 run_checkers()
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200119/work/gcc-10-20200119/gcc/analyzer/engine.cc:3624
0x10d9558 execute
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200119/work/gcc-10-20200119/gcc/analyzer/analyzer-pass.cc:84

Reply via email to