From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13881 invoked by alias); 30 Dec 2013 13:29:09 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 13866 invoked by uid 48); 30 Dec 2013 13:29:06 -0000 From: "reichelt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/59628] New: ICE with invalid OpenMP "declare reduction" clause Date: Mon, 30 Dec 2013 13:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: reichelt at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-12/txt/msg02395.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59628 Bug ID: 59628 Summary: ICE with invalid OpenMP "declare reduction" clause 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 invalid code snippet (compiled with "-fopenmp") triggers an ICE on trunk since 2013-10-11: ============================================================== struct A { int i; }; void foo() { A a; #pragma omp declare reduction (+: A: omp_out.i +: omp_in.i) #pragma omp parallel reduction (+: a) ; } ============================================================== bug.cc: In function 'void foo()': bug.cc:6:51: error: expected primary-expression before ':' token #pragma omp declare reduction (+: A: omp_out.i +: omp_in.i) ^ bug.cc:6:51: error: expected ')' before ':' token bug.cc:7:40: internal compiler error: Segmentation fault #pragma omp parallel reduction (+: a) ^ 0xb75baf crash_signal ../../gcc/gcc/toplev.c:336 0x713397 finish_omp_reduction_clause ../../gcc/gcc/cp/semantics.c:5023 0x713397 finish_omp_clauses(tree_node*) ../../gcc/gcc/cp/semantics.c:5751 0x686027 cp_parser_omp_all_clauses ../../gcc/gcc/cp/parser.c:28155 0x513e4e cp_parser_omp_parallel ../../gcc/gcc/cp/parser.c:29603 0x674827 cp_parser_omp_construct ../../gcc/gcc/cp/parser.c:30723 0x674827 cp_parser_pragma ../../gcc/gcc/cp/parser.c:31228 0x67ac2c cp_parser_statement ../../gcc/gcc/cp/parser.c:9433 0x67b5c9 cp_parser_statement_seq_opt ../../gcc/gcc/cp/parser.c:9740 0x67b73e cp_parser_compound_statement ../../gcc/gcc/cp/parser.c:9694 0x68f15b cp_parser_function_body ../../gcc/gcc/cp/parser.c:18610 0x68f15b cp_parser_ctor_initializer_opt_and_function_body ../../gcc/gcc/cp/parser.c:18646 0x6934fe cp_parser_function_definition_after_declarator ../../gcc/gcc/cp/parser.c:22678 0x694394 cp_parser_function_definition_from_specifiers_and_declarator ../../gcc/gcc/cp/parser.c:22590 0x694394 cp_parser_init_declarator ../../gcc/gcc/cp/parser.c:16588 0x69562f cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:11200 0x679003 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:11081 0x69fcd3 cp_parser_declaration ../../gcc/gcc/cp/parser.c:10978 0x69e9c8 cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10864 0x6a02ba cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:4018 Please submit a full bug report, [etc.] Jakub, this appeared right after your big OpenMP 4.0 patch (where "omp declare reduction" was introduced): 2013-10-11 Jakub Jelinek * decl.c (duplicate_decls): Error out for redeclaration of UDRs. (declare_simd_adjust_this): New function. (grokfndecl): If "omp declare simd" attribute is present, call declare_simd_adjust_this if needed and c_omp_declare_simd_clauses_to_numbers. [...] Would you mind having a look?