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

            Bug ID: 84341
           Summary: [6/7/8 Regression] ICE with #pragma omp atomic
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: 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
  Target Milestone: ---

The following invalid code snippet (compiled with "-fopenmp")
triggers an ICE since GCC 4.9.0:

========================
void foo(int i)
{
  #pragma omp atomic
    i = &i + 1;
}
========================

bug.cc: In function 'void foo(int)':
bug.cc:4:14: internal compiler error: in build2, at tree.c:4682
     i = &i + 1;
              ^
0x78d6b5 build2(tree_code, tree_node*, tree_node*, tree_node*)
        ../../gcc/gcc/tree.c:4681
0x911e31 build2_loc
        ../../gcc/gcc/tree.h:4112
0x911e31 cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:9333
0x932614 cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:9372
0x932614 cp_parser_omp_atomic
        ../../gcc/gcc/cp/parser.c:34277
0x9186ba cp_parser_omp_construct
        ../../gcc/gcc/cp/parser.c:38030
0x919a97 cp_parser_pragma
        ../../gcc/gcc/cp/parser.c:38704
0x91c05c cp_parser_statement
        ../../gcc/gcc/cp/parser.c:10877
0x91cc30 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:11255
0x91cd07 cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:11209
0x933460 cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:21747
0x933460 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.c:21784
0x933d10 cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.c:26685
0x934a27 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/gcc/cp/parser.c:26601
0x934a27 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:19473
0x93bac8 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:13038
0x93c8d8 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:12863
0x940832 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:12761
0x940c41 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:12637
0x940f34 cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4559
Please submit a full bug report, [etc.]

Reply via email to