https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79664
Bug ID: 79664 Summary: ICE with #pragma omp parallel in constexpr function Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org Target Milestone: --- The following code snippet (compiled with "-std=c++1y -fopenmp") triggers an ICE since GCC 5.1.0: ================================== constexpr int foo() { int i = 0; #pragma omp parallel for for ( i=0; i<10; ++i ) ; return 0; } ================================== bug.cc: In function 'constexpr int foo()': bug.cc:8:1: sorry, unimplemented: unexpected AST of kind omp_parallel } ^ bug.cc:8:1: internal compiler error: in potential_constant_expression_1, at cp/constexpr.c:4496 0x8531e4 potential_constant_expression_1 ../../gcc-5.1.0/gcc/cp/constexpr.c:4496 0x852c8d potential_constant_expression_1 ../../gcc-5.1.0/gcc/cp/constexpr.c:4102 0x853c00 potential_rvalue_constant_expression(tree_node*) ../../gcc-5.1.0/gcc/cp/constexpr.c:4521 0x853c00 register_constexpr_fundef(tree_node*, tree_node*) ../../gcc-5.1.0/gcc/cp/constexpr.c:782 0x67d445 maybe_save_function_definition ../../gcc-5.1.0/gcc/cp/decl.c:14095 0x67d445 finish_function(int) ../../gcc-5.1.0/gcc/cp/decl.c:14219 0x76c9c9 cp_parser_function_definition_after_declarator ../../gcc-5.1.0/gcc/cp/parser.c:23489 0x76d863 cp_parser_function_definition_from_specifiers_and_declarator ../../gcc-5.1.0/gcc/cp/parser.c:23395 0x76d863 cp_parser_init_declarator ../../gcc-5.1.0/gcc/cp/parser.c:17072 0x76f915 cp_parser_simple_declaration ../../gcc-5.1.0/gcc/cp/parser.c:11607 0x7693a3 cp_parser_block_declaration ../../gcc-5.1.0/gcc/cp/parser.c:11481 0x773249 cp_parser_declaration ../../gcc-5.1.0/gcc/cp/parser.c:11378 0x7718da cp_parser_declaration_seq_opt ../../gcc-5.1.0/gcc/cp/parser.c:11264 0x771bef cp_parser_translation_unit ../../gcc-5.1.0/gcc/cp/parser.c:4100 0x771bef c_parse_file() ../../gcc-5.1.0/gcc/cp/parser.c:33192 0x8a8ed2 c_common_parse_file() ../../gcc-5.1.0/gcc/c-family/c-opts.c:1057 Please submit a full bug report, [etc.]