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

            Bug ID: 85134
           Summary: [8 Regression] ICE with invalid constexpr in 'shared'
                    OpenMP clause
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: error-recovery, ice-on-invalid-code, openmp
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
                CC: jason at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet (compiled with "-fopenmp")
triggers an ICE on trunk.

=======================================
void foo(int i)
{
  constexpr int x[i] = {};

#pragma omp parallel shared(x)
  ;
}
=======================================

bug.cc: In function 'void foo(int)':
bug.cc:3:25: error: 'constexpr' variable 'x' has variably-modified type 'const
int [i]'
   constexpr int x[i] = {};
                         ^
bug.cc:5:9: internal compiler error: Segmentation fault
 #pragma omp parallel shared(x)
         ^~~
0xebc6ef crash_signal
        ../../gcc/gcc/toplev.c:325
0xc61cac omp_add_variable
        ../../gcc/gcc/gimplify.c:6820
0xc763de gimplify_scan_omp_clauses
        ../../gcc/gcc/gimplify.c:8355
0xc66155 gimplify_omp_parallel
        ../../gcc/gcc/gimplify.c:9520
0xc66155 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gcc/gimplify.c:11907
0xc698a6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gcc/gimplify.c:6658
0xc6a5cc gimplify_bind_expr
        ../../gcc/gcc/gimplify.c:1331
0xc676ba gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gcc/gimplify.c:11635
0xc698a6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gcc/gimplify.c:6658
0xc6b29a gimplify_body(tree_node*, bool)
        ../../gcc/gcc/gimplify.c:12635
0xc6b794 gimplify_function_tree(tree_node*)
        ../../gcc/gcc/gimplify.c:12800
0xaf02b7 cgraph_node::analyze()
        ../../gcc/gcc/cgraphunit.c:670
0xaf2c53 analyze_functions
        ../../gcc/gcc/cgraphunit.c:1131
0xaf3a52 symbol_table::finalize_compilation_unit()
        ../../gcc/gcc/cgraphunit.c:2691
Please submit a full bug report, [etc.]

The regression was introduced between 2018-02-25 and 2018-03-02,
most likely by Jason's fix r258015 for PR84559.
Before the code was wrongly accepted.

Reply via email to