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++/58702] New: [4.9 Regression] ICE with undeclared variable in OpenMP reduction clause
Date: Sat, 12 Oct 2013 21:08:00 -0000	[thread overview]
Message-ID: <bug-58702-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 58702
           Summary: [4.9 Regression] ICE with undeclared variable in
                    OpenMP 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:

=============================================
void foo()
{
  x;
#pragma omp parallel for reduction(+:x)
  for (int i = 0; i < 10; ++i) ;
}
=============================================

bug.cc: In function 'void foo()':
bug.cc:3:3: error: 'x' was not declared in this scope
   x;
   ^
bug.cc:4:40: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in finish_omp_reduction_clause, at
cp/semantics.c:4966
 #pragma omp parallel for reduction(+:x)
                                        ^
0xd14f79 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc/gcc/tree.c:9351
0x6df624 tree_class_check
        ../../gcc/gcc/tree.h:2797
0x6df624 finish_omp_reduction_clause
        ../../gcc/gcc/cp/semantics.c:4966
0x6df624 finish_omp_clauses(tree_node*)
        ../../gcc/gcc/cp/semantics.c:5709
0x634b1e cp_omp_split_clauses
        ../../gcc/gcc/cp/parser.c:28967
0x66873e cp_parser_omp_for
        ../../gcc/gcc/cp/parser.c:29079
0x668c4b cp_parser_omp_parallel
        ../../gcc/gcc/cp/parser.c:29259
0x63f221 cp_parser_omp_construct
        ../../gcc/gcc/cp/parser.c:30380
0x63f221 cp_parser_pragma
        ../../gcc/gcc/cp/parser.c:30885
0x64555c cp_parser_statement
        ../../gcc/gcc/cp/parser.c:9297
0x646342 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:9604
0x646486 cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:9558
0x659b0b cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:18401
0x659b0b cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.c:18437
0x65df0f cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.c:22444
0x65ece2 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/gcc/cp/parser.c:22365
0x65ece2 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:16412
0x65ff2f cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11047
0x643860 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:10928
0x66aaae cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:10825
Please submit a full bug report, [etc.]

The regression was introduced between 2013-10-09 and 2013-10-11.


             reply	other threads:[~2013-10-12 21:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-12 21:08 reichelt at gcc dot gnu.org [this message]
2013-10-12 21:09 ` [Bug c++/58702] " reichelt at gcc dot gnu.org
2013-10-14  9:02 ` rguenth at gcc dot gnu.org
2014-01-29 10:38 ` paolo.carlini at oracle dot com
2014-01-29 13:36 ` paolo at gcc dot gnu.org
2014-01-29 13:37 ` 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-58702-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).