Bug 94011 - ICE in validate, at analyzer/region-model.cc:3727
Summary: ICE in validate, at analyzer/region-model.cc:3727
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: analyzer (show other bugs)
Version: 10.0
: P3 normal
Target Milestone: ---
Assignee: David Malcolm
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2020-03-03 07:09 UTC by Arseny Solokha
Modified: 2020-08-13 20:26 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2020-03-03 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arseny Solokha 2020-03-03 07:09:31 UTC
g++-10.0.1-alpha20200301 snapshot (g:151bf47e78f5d919f6cc591d11cc1f6aff61078f) ICEs when compiling the following testcase w/ -O1 -fanalyzer:

template <typename DV> DV
vu (DV j4)
{
  return [j4] () { return j4 () ? j4 : throw j4 (); } ();
}

void
foo ()
{
  auto n1 = [] { return nullptr; };

  vu (n1);
}

% g++-10.0.1 -O1 -fanalyzer -c ubufsom0.cc
during IPA pass: analyzer
ubufsom0.cc: In lambda function:
ubufsom0.cc:4:40: internal compiler error: in validate, at analyzer/region-model.cc:3727
    4 |   return [j4] () { return j4 () ? j4 : throw j4 (); } ();
      |                                        ^~~~~~~~~~~
0x7dc6fd ana::region_model::validate() const
	/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/region-model.cc:3727
0x135f8d7 ana::region_model::handle_unrecognized_call(gcall const*, ana::region_model_context*)
	/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/region-model.cc:4494
0x133cc30 ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode const*, gimple const*, ana::program_state*, ana::state_change*) const
	/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/engine.cc:1107
0x133d3c1 ana::exploded_graph::process_node(ana::exploded_node*)
	/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/engine.cc:2517
0x133d8aa ana::exploded_graph::process_worklist()
	/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/engine.cc:2335
0x133dfd9 ana::impl_run_checkers(ana::logger*)
	/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/engine.cc:3793
0x133ea7c ana::run_checkers()
	/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/engine.cc:3850
0x1333908 execute
	/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/analyzer-pass.cc:84
Comment 1 Martin Liška 2020-03-03 08:31:59 UTC
Confirmed, started with initial analyzer commit:
r10-5950-g757bf1dff5e8cee3
Comment 2 Arseny Solokha 2020-03-08 13:29:17 UTC
I see similar ICE when compiling gcc/testsuite/g++.old-deja/g++.eh/ptrmem1.C even w/ -fanalyzer alone.
Comment 3 David Malcolm 2020-08-13 20:26:13 UTC
The ICE should be fixed by 808f4dfeb3a95f50f15e71148e5c1067f90a126d (for GCC 11).  Marking this as fixed.