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

            Bug ID: 101516
           Summary: [10/11/12 Regression] ICE in
                    finish_omp_reduction_clause, at cp/semantics.c:6075
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r10 between 20191006 and 20191013 :


$ cat z1.cc
template <typename T> void foo (T, T[], T *, int, int (& v)[], int *)
{
  #pragma omp parallel reduction (+:v) allocate(v)
  ;
}
void test ()
  {
  long x;
  long y[] {};
  long * z;
  int u;
  int v[4];
  int * w;
  foo (x, y, z, u, v, w);
}


$ g++-12-20210718 -c z1.cc -fopenmp
z1.cc: In instantiation of 'void foo(T, T*, T*, int, int (&)[], int*) [with T =
long int]':
z1.cc:14:7:   required from here
z1.cc:3:11: internal compiler error: Segmentation fault
    3 |   #pragma omp parallel reduction (+:v) allocate(v)
      |           ^~~
0xd6d5af crash_signal
        ../../gcc/toplev.c:328
0xa9bbdf size_binop_loc(unsigned int, tree_code, tree_node*, tree_node*)
        ../../gcc/fold-const.c:1897
0x87082d finish_omp_reduction_clause
        ../../gcc/cp/semantics.c:6075
0x87082d finish_omp_clauses(tree_node*, c_omp_region_type)
        ../../gcc/cp/semantics.c:8597
0x846fe0 tsubst_omp_clauses
        ../../gcc/cp/pt.c:17555
0x841f9a tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18669
0x841f47 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18479
0x8367d1 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:25869
0x8367d1 instantiate_body
        ../../gcc/cp/pt.c:25869
0x837789 instantiate_decl(tree_node*, bool, bool)
        ../../gcc/cp/pt.c:26162
0x85152b instantiate_pending_templates(int)
        ../../gcc/cp/pt.c:26241
0x765822 c_parse_final_cleanups()
        ../../gcc/cp/decl2.c:4991

Reply via email to