public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "reichelt at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-59628-4@http.gcc.gnu.org/bugzilla/> (raw)

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  <jakub@redhat.com>

    * 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?


             reply	other threads:[~2013-12-30 13:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-30 13:29 reichelt at gcc dot gnu.org [this message]
2014-12-12 17:55 ` [Bug c++/59628] " paolo.carlini at oracle dot com
2014-12-12 21:50 ` paolo at gcc dot gnu.org
2014-12-12 21:55 ` paolo.carlini at oracle dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-59628-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).