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

            Bug ID: 105092
           Summary: ICE in get_region_for_local, at analyzer/region.cc:874
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, openmp
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++ 12.0.1 20220327 snapshot (g:08e69332881f8d28ce8b559ffba1900ae5c0d5ee) ICEs
when compiling the following testcase, reduced from
gcc/testsuite/g++.dg/gomp/depend-iterator-3.C, w/ -fanalyzer -fopenmp:

struct S {
  S () {}
};

template <typename T>
struct U {
  T c[10];
  U () {
#pragma omp task affinity (iterator (i = 0 : 10 : 1): c[i])
    ;
  }
};

U<S> v;

% g++-12.0.1 -fanalyzer -fopenmp -c r3zw7jzh.C
during IPA pass: analyzer
r3zw7jzh.C: In constructor 'U<T>::U() [with T = S]':
r3zw7jzh.C:9:38: internal compiler error: in get_region_for_local, at
analyzer/region.cc:874
    9 | #pragma omp task affinity (iterator (i = 0 : 10 : 1): c[i])
      |                                      ^
0x89a98a ana::frame_region::get_region_for_local(ana::region_model_manager*,
tree_node*, ana::region_model_context const*) const
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220327/work/gcc-12-20220327/gcc/analyzer/region.cc:874
0x157a169 ana::region_model::get_lvalue(ana::path_var,
ana::region_model_context*) const
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220327/work/gcc-12-20220327/gcc/analyzer/region-model.cc:2136
0x157a169 ana::region_model::get_lvalue(tree_node*, ana::region_model_context*)
const
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220327/work/gcc-12-20220327/gcc/analyzer/region-model.cc:2147
0x15801e6 ana::region_model::on_assignment(gassign const*,
ana::region_model_context*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220327/work/gcc-12-20220327/gcc/analyzer/region-model.cc:1040
0x155665f 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_p20220327/work/gcc-12-20220327/gcc/analyzer/engine.cc:1361
0x1559a43 ana::exploded_graph::process_node(ana::exploded_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220327/work/gcc-12-20220327/gcc/analyzer/engine.cc:3755
0x155aa3a ana::exploded_graph::process_worklist()
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220327/work/gcc-12-20220327/gcc/analyzer/engine.cc:3198
0x155d101 ana::impl_run_checkers(ana::logger*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220327/work/gcc-12-20220327/gcc/analyzer/engine.cc:5777
0x155e02e ana::run_checkers()
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220327/work/gcc-12-20220327/gcc/analyzer/engine.cc:5851
0x154ccb8 execute
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220327/work/gcc-12-20220327/gcc/analyzer/analyzer-pass.cc:87

Reply via email to