http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58874

            Bug ID: 58874
           Summary: [4.9 Regression] [c++11] ICE with OpenMP reduction
                    declaration and -std=c++11
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org

The following valid code snippet triggers an ICE on trunk if compiled with
"-fopenmp -std=c++11"):

==========================================================================
struct A
{
  template<int> struct B
  {
    #pragma omp declare reduction (x : int : omp_out |= omp_in)
  };
};

#pragma omp declare reduction (x : int : omp_out |= omp_in) initializer
(omp_priv = 0)
==========================================================================

bug.cc: In function 'void omp declare reduction x~i(int&)':
bug.cc:13:85: sorry, unimplemented: unexpected AST of kind decl_expr
 #pragma omp declare reduction (x : int : omp_out |= omp_in) initializer
(omp_priv = 0)
                                                                               
     ^
bug.cc:13:85: internal compiler error: in potential_constant_expression_1, at
cp/semantics.c:10426
0x6df5dc potential_constant_expression_1
        ../../gcc/gcc/cp/semantics.c:10426
0x5a9c14 fold_non_dependent_expr_sfinae(tree_node*, int)
        ../../gcc/gcc/cp/pt.c:5087
0x5a9c89 build_non_dependent_expr(tree_node*)
        ../../gcc/gcc/cp/pt.c:21210
0x6c3a10 finish_expr_stmt(tree_node*)
        ../../gcc/gcc/cp/semantics.c:628
0x66a8b4 cp_parser_omp_declare_reduction_exprs
        ../../gcc/gcc/cp/parser.c:30078
0x643b1a cp_parser_omp_declare_reduction
        ../../gcc/gcc/cp/parser.c:30291
0x64551b cp_parser_omp_declare
        ../../gcc/gcc/cp/parser.c:30355
0x64551b cp_parser_pragma
        ../../gcc/gcc/cp/parser.c:30890
0x66f661 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10725
0x670f36 cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:3990
0x670f36 c_parse_file()
        ../../gcc/gcc/cp/parser.c:30999
0x78e183 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1046
Please submit a full bug report, [etc.]

The code compiles fine without "-std=c++11".
The regression was introduced between 4.9.0 20131005 and 4.9.0 20131012.

Reply via email to