[Bug analyzer/104997] New: ICE in add_note, at analyzer/diagnostic-manager.cc:946

asolokha at gmx dot com gcc-bugzilla@gcc.gnu.org
Mon Mar 21 11:27:31 GMT 2022


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

            Bug ID: 104997
           Summary: ICE in add_note, at analyzer/diagnostic-manager.cc:946
           Product: gcc
           Version: 12.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 12.0.1 20220320 snapshot (g:6f30c4cd38b8385d62358065d795df590e752d6e) ICEs
when compiling gcc/testsuite/gcc.dg/analyzer/write-to-string-literal-4.c w/
-fanalyzer -w (note -w!):

% gcc-12.0.1 -fanalyzer -w -c
gcc/testsuite/gcc.dg/analyzer/write-to-string-literal-4.c
during IPA pass: analyzer
gcc/testsuite/gcc.dg/analyzer/write-to-string-literal-4.c: In function 'test':
gcc/testsuite/gcc.dg/analyzer/write-to-string-literal-4.c:18:7: internal
compiler error: in add_note, at analyzer/diagnostic-manager.cc:946
   18 |   if (getrandom(buf, 16, GRND_RANDOM)) /* { dg-warning "write to string
literal" } */
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x85782d ana::diagnostic_manager::add_note(ana::pending_note*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220320/work/gcc-12-20220320/gcc/analyzer/diagnostic-manager.cc:946
0x12a8fc5 ana::region_model_context_decorator::add_note(ana::pending_note*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220320/work/gcc-12-20220320/gcc/analyzer/region-model.h:1040
0x12a8fc5 ana::note_adding_context::warn(ana::pending_diagnostic*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220320/work/gcc-12-20220320/gcc/analyzer/region-model.h:1151
0x12a8fc5 ana::note_adding_context::warn(ana::pending_diagnostic*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220320/work/gcc-12-20220320/gcc/analyzer/region-model.h:1147
0x129d8cb ana::region_model::check_for_writable_region(ana::region const*,
ana::region_model_context*) const
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220320/work/gcc-12-20220320/gcc/analyzer/region-model.cc:2661
0x129d8cb ana::region_model::check_region_access(ana::region const*,
ana::access_direction, ana::region_model_context*) const
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220320/work/gcc-12-20220320/gcc/analyzer/region-model.cc:2763
0x129d8cb ana::region_model::check_region_for_write(ana::region const*,
ana::region_model_context*) const
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220320/work/gcc-12-20220320/gcc/analyzer/region-model.cc:2774
0x129d8cb ana::region_model::check_external_function_for_access_attr(gcall
const*, tree_node*, ana::region_model_context*) const
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220320/work/gcc-12-20220320/gcc/analyzer/region-model.cc:1723
0x12a5483 ana::region_model::handle_unrecognized_call(gcall const*,
ana::region_model_context*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220320/work/gcc-12-20220320/gcc/analyzer/region-model.cc:1745
0x1273cad ana::exploded_node::on_stmt_post(gimple const*, ana::program_state*,
bool, ana::region_model_context*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220320/work/gcc-12-20220320/gcc/analyzer/engine.cc:1453
0x1273cad ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*, ana::uncertainty_t*,
ana::path_context*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220320/work/gcc-12-20220320/gcc/analyzer/engine.cc:1390
0x1276ef3 ana::exploded_graph::process_node(ana::exploded_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220320/work/gcc-12-20220320/gcc/analyzer/engine.cc:3758
0x1277eea ana::exploded_graph::process_worklist()
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220320/work/gcc-12-20220320/gcc/analyzer/engine.cc:3201
0x127a590 ana::impl_run_checkers(ana::logger*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220320/work/gcc-12-20220320/gcc/analyzer/engine.cc:5780
0x127b48e ana::run_checkers()
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220320/work/gcc-12-20220320/gcc/analyzer/engine.cc:5851
0x126a168 execute
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220320/work/gcc-12-20220320/gcc/analyzer/analyzer-pass.cc:87


More information about the Gcc-bugs mailing list