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

            Bug ID: 104417
           Summary: [12 Regression] ICE in check_dynamic_size_for_taint,
                    at analyzer/sm-taint.cc:1058
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc 12.0.1 20220206 snapshot (g:8eb329e963593342855b6072e5692659107337b7) ICEs
when compiling the following testcase, reduced from
gcc/testsuite/gcc.dg/Wfree-nonheap-object-2.c, w/ -fanalyzer:

char eparr[1];

void *
warn_realloc_extern_ptrarr_offset (int i, int n)
{
  return __builtin_realloc (eparr + i, n);
}

% gcc-12.0.1 -fanalyzer -c e9xvubm5.c
during IPA pass: analyzer
e9xvubm5.c: In function 'warn_realloc_extern_ptrarr_offset':
e9xvubm5.c:6:10: internal compiler error: in check_dynamic_size_for_taint, at
analyzer/sm-taint.cc:1058
    6 |   return __builtin_realloc (eparr + i, n);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x7b4ac7 ana::region_model::check_dynamic_size_for_taint(ana::memory_space,
ana::svalue const*, ana::region_model_context*) const
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220206/work/gcc-12-20220206/gcc/analyzer/sm-taint.cc:1058
0x1299852 ana::region_model::set_dynamic_extents(ana::region const*,
ana::svalue const*, ana::region_model_context*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220206/work/gcc-12-20220206/gcc/analyzer/region-model.cc:3895
0x12a3510 update_model
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220206/work/gcc-12-20220206/gcc/analyzer/region-model-impl-calls.cc:667
0x1270a0b ana::exploded_graph::process_node(ana::exploded_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220206/work/gcc-12-20220206/gcc/analyzer/engine.cc:3808
0x127157a ana::exploded_graph::process_worklist()
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220206/work/gcc-12-20220206/gcc/analyzer/engine.cc:3137
0x1273c00 ana::impl_run_checkers(ana::logger*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220206/work/gcc-12-20220206/gcc/analyzer/engine.cc:5716
0x1274afe ana::run_checkers()
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220206/work/gcc-12-20220206/gcc/analyzer/engine.cc:5787
0x1263808 execute
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220206/work/gcc-12-20220206/gcc/analyzer/analyzer-pass.cc:87

Reply via email to