From patchwork Wed Jul 3 17:30:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 256719 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id E75332C0091 for ; Thu, 4 Jul 2013 03:31:25 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; q=dns; s=default; b=T1L1lVf+dhx+klPSR34SBZNUb+mPV fXUw0s630m+sfRQqEiYo3uT9RIjeiisbkhqgBiFfDy3mb48R2j7ARivhRcJF7SEO zjbgC0Iv0UBoNUeHoKDsQCrAE407KUB4ndslRHms47uExqwC/PSgUtzGJ5JE2lsi k2JDlqs855XAuo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; s=default; bh=IZvfpUwWSlt+JAlEvPIRmFvo0qE=; b=QVN oU4+zt6hvSKpuHEQAVYGxnJf/yaLrz3uyzTm0KHlOIQfSHmwzUDq1xf+i++52tdK k4TYcm8AuAIRGhp0cgIpbfXS19dHA13DqNRnxhUxUn2PaZiPl5rbAXTGned0K9va n3bV1g+TCpnV/afJbuA3vM2Ojyl55mpz0t6NW/Sg= Received: (qmail 28677 invoked by alias); 3 Jul 2013 17:31:17 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 28666 invoked by uid 89); 3 Jul 2013 17:31:17 -0000 X-Spam-SWARE-Status: No, score=-4.9 required=5.0 tests=AWL, BAYES_50, FILL_THIS_FORM, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS, TW_TM autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 03 Jul 2013 17:30:56 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r63HUtQt022299 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 3 Jul 2013 13:30:55 -0400 Received: from zalov.cz (vpn1-7-109.ams2.redhat.com [10.36.7.109]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r63HUrih018514 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 3 Jul 2013 13:30:54 -0400 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.cz (8.14.5/8.14.5) with ESMTP id r63HUqpJ032763; Wed, 3 Jul 2013 19:30:52 +0200 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id r63HUqKe032762; Wed, 3 Jul 2013 19:30:52 +0200 Date: Wed, 3 Jul 2013 19:30:52 +0200 From: Jakub Jelinek To: Richard Henderson Cc: gcc-patches@gcc.gnu.org Subject: [gomp4] 3 minor OpenMP parsing tweaks Message-ID: <20130703173051.GR2336@tucnak.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Hi! I've noticed today or recently 3 separate issues that this patch attempts to address. 1) the sections syntax is (and has been that way already back in OpenMP 2.5): #pragma omp sections [clause[[,] clause] ...] new-line { [#pragma omp section new-line] structured-block [#pragma omp section new-line structured-block ] ... } but we were happily allowing a sequence of statements before first #pragma omp section, rather than a single statement or { sequence of statements }. 2) on single construct, there is a restriction: "The copyprivate clause must not be used with the nowait clause." that we weren't actually enforcing - came over this by seeing that we would just force a barrier when seeing a copyprivate, so essentially silently ignoring the nowait clause. Again, this is already in OpenMP 2.5. 3) the seq_cst in the syntax in OpenMP 4.0 has to come after atomic-clause and no comma is allowed in between those two (both in atomic construct description and in the appendix grammar). Richard, does this look ok to you? 2013-07-03 Jakub Jelinek * omp-low.c (expand_omp_single): Don't force barrier for copyprivate. gcc/c/ * c-parser.c (c_parser_omp_atomic): Disallow seq_cst before atomic-clause, disallow comma in between atomic-clause and seq_cst. (c_parser_omp_sections_scope): If section-sequence doesn't start with #pragma omp section, require exactly one structured-block instead of sequence of statements. * c-typeck.c (c_finish_omp_clauses): Diagnose copyprivate clause appearing together with nowait clause. gcc/cp/ * parser.c (cp_parser_omp_atomic): Disallow seq_cst before atomic-clause, disallow comma in between atomic-clause and seq_cst. (cp_parser_omp_sections_scope): If section-sequence doesn't start with #pragma omp section, require exactly one structured-block instead of sequence of statements. * semantics.c (finish_omp_clauses): Diagnose copyprivate clause appearing together with nowait clause. gcc/testsuite/ * g++.dg/gomp/block-0.C: Adjust for stricter #pragma omp sections parser. * g++.dg/gomp/block-3.C: Likewise. * gcc.dg/gomp/block-3.c: Likewise. * gcc.dg/gomp/nesting-1.c: Likewise. Add further #pragma omp sections nesting tests. * c-c++-common/gomp/sections1.c: New test. * c-c++-common/gomp/single1.c: New test. * c-c++-common/gomp/atomic-16.c: New test. libgomp/ * testsuite/libgomp.c++/atomic-14.C: Adjust for stricter atomic seq_cst parser. * testsuite/libgomp.c++/atomic-15.C: Likewise. * testsuite/libgomp.c/atomic-17.c: Likewise. Jakub --- gcc/c/c-parser.c.jj 2013-06-26 12:13:50.000000000 +0200 +++ gcc/c/c-parser.c 2013-07-03 17:17:40.614573329 +0200 @@ -10391,18 +10391,6 @@ c_parser_omp_atomic (location_t loc, c_p if (c_parser_next_token_is (parser, CPP_NAME)) { const char *p = IDENTIFIER_POINTER (c_parser_peek_token (parser)->value); - if (!strcmp (p, "seq_cst")) - { - seq_cst = true; - c_parser_consume_token (parser); - if (c_parser_next_token_is (parser, CPP_COMMA) - && c_parser_peek_2nd_token (parser)->type == CPP_NAME) - c_parser_consume_token (parser); - } - } - if (c_parser_next_token_is (parser, CPP_NAME)) - { - const char *p = IDENTIFIER_POINTER (c_parser_peek_token (parser)->value); if (!strcmp (p, "read")) code = OMP_ATOMIC_READ; @@ -10417,21 +10405,13 @@ c_parser_omp_atomic (location_t loc, c_p if (p) c_parser_consume_token (parser); } - if (!seq_cst) + if (c_parser_next_token_is (parser, CPP_NAME)) { - if (c_parser_next_token_is (parser, CPP_COMMA) - && c_parser_peek_2nd_token (parser)->type == CPP_NAME) - c_parser_consume_token (parser); - - if (c_parser_next_token_is (parser, CPP_NAME)) + const char *p = IDENTIFIER_POINTER (c_parser_peek_token (parser)->value); + if (!strcmp (p, "seq_cst")) { - const char *p - = IDENTIFIER_POINTER (c_parser_peek_token (parser)->value); - if (!strcmp (p, "seq_cst")) - { - seq_cst = true; - c_parser_consume_token (parser); - } + seq_cst = true; + c_parser_consume_token (parser); } } c_parser_skip_to_pragma_eol (parser); @@ -11231,21 +11211,7 @@ c_parser_omp_sections_scope (location_t if (c_parser_peek_token (parser)->pragma_kind != PRAGMA_OMP_SECTION) { - substmt = push_stmt_list (); - - while (1) - { - c_parser_statement (parser); - - if (c_parser_peek_token (parser)->pragma_kind == PRAGMA_OMP_SECTION) - break; - if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE)) - break; - if (c_parser_next_token_is (parser, CPP_EOF)) - break; - } - - substmt = pop_stmt_list (substmt); + substmt = c_parser_omp_structured_block (parser); substmt = build1 (OMP_SECTION, void_type_node, substmt); SET_EXPR_LOCATION (substmt, loc); add_stmt (substmt); --- gcc/c/c-typeck.c.jj 2013-07-03 11:17:05.000000000 +0200 +++ gcc/c/c-typeck.c 2013-07-03 17:26:32.459907384 +0200 @@ -10748,6 +10748,8 @@ c_finish_omp_clauses (tree clauses) tree c, t, *pc = &clauses; const char *name; bool branch_seen = false; + bool copyprivate_seen = false; + tree *nowait_clause = NULL; bitmap_obstack_initialize (NULL); bitmap_initialize (&generic_head, &bitmap_default_obstack); @@ -10828,6 +10830,15 @@ c_finish_omp_clauses (tree clauses) case OMP_CLAUSE_COPYPRIVATE: name = "copyprivate"; + copyprivate_seen = true; + if (nowait_clause) + { + error_at (OMP_CLAUSE_LOCATION (*nowait_clause), + "% clause must not be used together " + "with %"); + *nowait_clause = OMP_CLAUSE_CHAIN (*nowait_clause); + nowait_clause = NULL; + } goto check_dup_generic; case OMP_CLAUSE_COPYIN: @@ -10994,10 +11005,22 @@ c_finish_omp_clauses (tree clauses) } break; + case OMP_CLAUSE_NOWAIT: + if (copyprivate_seen) + { + error_at (OMP_CLAUSE_LOCATION (c), + "% clause must not be used together " + "with %"); + remove = true; + break; + } + nowait_clause = pc; + pc = &OMP_CLAUSE_CHAIN (c); + continue; + case OMP_CLAUSE_IF: case OMP_CLAUSE_NUM_THREADS: case OMP_CLAUSE_SCHEDULE: - case OMP_CLAUSE_NOWAIT: case OMP_CLAUSE_ORDERED: case OMP_CLAUSE_DEFAULT: case OMP_CLAUSE_UNTIED: --- gcc/cp/parser.c.jj 2013-07-02 10:27:52.000000000 +0200 +++ gcc/cp/parser.c 2013-07-03 17:00:20.406911035 +0200 @@ -27939,20 +27939,6 @@ cp_parser_omp_atomic (cp_parser *parser, tree id = cp_lexer_peek_token (parser->lexer)->u.value; const char *p = IDENTIFIER_POINTER (id); - if (!strcmp (p, "seq_cst")) - { - seq_cst = true; - cp_lexer_consume_token (parser->lexer); - if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA) - && cp_lexer_peek_nth_token (parser->lexer, 2)->type == CPP_NAME) - cp_lexer_consume_token (parser->lexer); - } - } - if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)) - { - tree id = cp_lexer_peek_token (parser->lexer)->u.value; - const char *p = IDENTIFIER_POINTER (id); - if (!strcmp (p, "read")) code = OMP_ATOMIC_READ; else if (!strcmp (p, "write")) @@ -27966,22 +27952,16 @@ cp_parser_omp_atomic (cp_parser *parser, if (p) cp_lexer_consume_token (parser->lexer); } - if (!seq_cst) + + if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)) { - if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA) - && cp_lexer_peek_nth_token (parser->lexer, 2)->type == CPP_NAME) - cp_lexer_consume_token (parser->lexer); + tree id = cp_lexer_peek_token (parser->lexer)->u.value; + const char *p = IDENTIFIER_POINTER (id); - if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)) + if (!strcmp (p, "seq_cst")) { - tree id = cp_lexer_peek_token (parser->lexer)->u.value; - const char *p = IDENTIFIER_POINTER (id); - - if (!strcmp (p, "seq_cst")) - { - seq_cst = true; - cp_lexer_consume_token (parser->lexer); - } + seq_cst = true; + cp_lexer_consume_token (parser->lexer); } } cp_parser_require_pragma_eol (parser, pragma_tok); @@ -29079,26 +29059,7 @@ cp_parser_omp_sections_scope (cp_parser if (cp_lexer_peek_token (parser->lexer)->pragma_kind != PRAGMA_OMP_SECTION) { - unsigned save; - - substmt = begin_omp_structured_block (); - save = cp_parser_begin_omp_structured_block (parser); - - while (1) - { - cp_parser_statement (parser, NULL_TREE, false, NULL); - - tok = cp_lexer_peek_token (parser->lexer); - if (tok->pragma_kind == PRAGMA_OMP_SECTION) - break; - if (tok->type == CPP_CLOSE_BRACE) - break; - if (tok->type == CPP_EOF) - break; - } - - cp_parser_end_omp_structured_block (parser, save); - substmt = finish_omp_structured_block (substmt); + substmt = cp_parser_omp_structured_block (parser); substmt = build1 (OMP_SECTION, void_type_node, substmt); add_stmt (substmt); } --- gcc/cp/semantics.c.jj 2013-07-02 11:47:51.000000000 +0200 +++ gcc/cp/semantics.c 2013-07-03 17:08:05.704191136 +0200 @@ -4555,6 +4555,7 @@ finish_omp_clauses (tree clauses) tree c, t, *pc = &clauses; const char *name; bool branch_seen = false; + bool copyprivate_seen = false; bitmap_obstack_initialize (NULL); bitmap_initialize (&generic_head, &bitmap_default_obstack); @@ -4579,6 +4580,7 @@ finish_omp_clauses (tree clauses) goto check_dup_generic; case OMP_CLAUSE_COPYPRIVATE: name = "copyprivate"; + copyprivate_seen = true; goto check_dup_generic; case OMP_CLAUSE_COPYIN: name = "copyin"; @@ -5099,6 +5101,16 @@ finish_omp_clauses (tree clauses) name = "copyin"; need_copy_assignment = true; break; + case OMP_CLAUSE_NOWAIT: + if (copyprivate_seen) + { + error_at (OMP_CLAUSE_LOCATION (c), + "% clause must not be used together " + "with %"); + *pc = OMP_CLAUSE_CHAIN (c); + continue; + } + /* FALLTHRU */ default: pc = &OMP_CLAUSE_CHAIN (c); continue; --- gcc/omp-low.c.jj 2013-07-03 10:47:23.000000000 +0200 +++ gcc/omp-low.c 2013-07-03 18:33:44.096675606 +0200 @@ -6660,24 +6660,17 @@ expand_omp_single (struct omp_region *re { basic_block entry_bb, exit_bb; gimple_stmt_iterator si; - bool need_barrier = false; entry_bb = region->entry; exit_bb = region->exit; si = gsi_last_bb (entry_bb); - /* The terminal barrier at the end of a GOMP_single_copy sequence cannot - be removed. We need to ensure that the thread that entered the single - does not exit before the data is copied out by the other threads. */ - if (find_omp_clause (gimple_omp_single_clauses (gsi_stmt (si)), - OMP_CLAUSE_COPYPRIVATE)) - need_barrier = true; gcc_assert (gimple_code (gsi_stmt (si)) == GIMPLE_OMP_SINGLE); gsi_remove (&si, true); single_succ_edge (entry_bb)->flags = EDGE_FALLTHRU; si = gsi_last_bb (exit_bb); - if (!gimple_omp_return_nowait_p (gsi_stmt (si)) || need_barrier) + if (!gimple_omp_return_nowait_p (gsi_stmt (si))) { tree t = gimple_omp_return_lhs (gsi_stmt (si)); gsi_insert_after (&si, build_omp_barrier (t), GSI_SAME_STMT); --- gcc/testsuite/g++.dg/gomp/block-0.C.jj 2013-03-20 10:06:58.000000000 +0100 +++ gcc/testsuite/g++.dg/gomp/block-0.C 2013-07-03 19:07:08.267301734 +0200 @@ -22,8 +22,10 @@ void foo() bar (); #pragma omp parallel sections { - bar (); - bar (); + { + bar (); + bar (); + } #pragma omp section bar (); } --- gcc/testsuite/g++.dg/gomp/block-3.C.jj 2013-03-20 10:06:58.000000000 +0100 +++ gcc/testsuite/g++.dg/gomp/block-3.C 2013-07-03 19:07:53.568555524 +0200 @@ -35,8 +35,10 @@ void foo() #pragma omp sections { - goto ok1; - ok1:; + { + goto ok1; + ok1:; + } #pragma omp section for (i = 0; i < 10; ++i) --- gcc/testsuite/gcc.dg/gomp/block-3.c.jj 2013-03-20 10:06:09.000000000 +0100 +++ gcc/testsuite/gcc.dg/gomp/block-3.c 2013-07-03 19:08:46.877316777 +0200 @@ -35,9 +35,10 @@ void foo() #pragma omp sections { - goto ok1; - ok1:; - + { + goto ok1; + ok1:; + } #pragma omp section for (i = 0; i < 10; ++i) if (test(i)) --- gcc/testsuite/gcc.dg/gomp/nesting-1.c.jj 2013-03-20 10:06:09.000000000 +0100 +++ gcc/testsuite/gcc.dg/gomp/nesting-1.c 2013-07-03 19:12:20.836748856 +0200 @@ -28,17 +28,58 @@ f1 (void) #pragma omp for /* { dg-error "may not be closely nested" } */ for (j = 0; j < 3; j++) ; + } + #pragma omp sections + { #pragma omp sections /* { dg-error "may not be closely nested" } */ { ; #pragma omp section ; } + } + #pragma omp sections + { #pragma omp single /* { dg-error "may not be closely nested" } */ ; + } + #pragma omp sections + { #pragma omp master /* { dg-error "may not be closely nested" } */ ; + } + #pragma omp sections + { + #pragma omp section + ; + } + #pragma omp sections + { #pragma omp section + #pragma omp for /* { dg-error "may not be closely nested" } */ + for (j = 0; j < 3; j++) + ; + } + #pragma omp sections + { + #pragma omp section + #pragma omp sections /* { dg-error "may not be closely nested" } */ + { + ; + #pragma omp section + ; + } + } + #pragma omp sections + { + #pragma omp section + #pragma omp single /* { dg-error "may not be closely nested" } */ + ; + } + #pragma omp sections + { + #pragma omp section + #pragma omp master /* { dg-error "may not be closely nested" } */ ; } #pragma omp single --- gcc/testsuite/c-c++-common/gomp/sections1.c.jj 2013-07-03 18:48:43.964833172 +0200 +++ gcc/testsuite/c-c++-common/gomp/sections1.c 2013-07-03 19:04:21.378038799 +0200 @@ -0,0 +1,73 @@ +/* { dg-do compile } */ +/* { dg-options "-fopenmp" } */ + +void bar (int); + +void +foo () +{ + #pragma omp sections + { + bar (1); + #pragma omp section + { + bar (2); + } + } + #pragma omp sections + { + #pragma omp section + bar (3); + #pragma omp section + { + bar (4); + bar (5); + } + } + #pragma omp sections + { + { + bar (6); + bar (7); + } + #pragma omp section + bar (8); + } + #pragma omp sections + { + #pragma omp section + { + bar (9); + } + #pragma omp section + bar (10); + #pragma omp section + bar (11); + } + #pragma omp sections + { + } /* { dg-error "expression before" } */ + #pragma omp sections + { + bar (12); + bar (13); /* { dg-error "pragma omp section" } */ + #pragma omp section + bar (14); + } + #pragma omp sections + { + #pragma omp section + } /* { dg-error "expression before" } */ + #pragma omp sections + { + bar (15); + #pragma omp section + bar (16); + bar (17); /* { dg-error "pragma omp section" } */ + } + #pragma omp sections + { + bar (18); + #pragma omp section + } /* { dg-error "expression before" } */ +} --- gcc/testsuite/c-c++-common/gomp/single1.c.jj 2013-07-03 18:47:35.134974552 +0200 +++ gcc/testsuite/c-c++-common/gomp/single1.c 2013-07-03 19:06:12.386216714 +0200 @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-fopenmp" } */ + +void +foo (int i) +{ + #pragma omp single copyprivate (i) + ; + #pragma omp single nowait + ; + #pragma omp single copyprivate (i) nowait /* { dg-error "clause must not be used together with" } */ + ; + #pragma omp single nowait copyprivate (i) /* { dg-error "clause must not be used together with" } */ + ; +} --- gcc/testsuite/c-c++-common/gomp/atomic-16.c.jj 2013-07-03 18:53:14.907454993 +0200 +++ gcc/testsuite/c-c++-common/gomp/atomic-16.c 2013-07-03 19:02:19.171998602 +0200 @@ -0,0 +1,34 @@ +/* { dg-do compile } */ +/* { dg-options "-fopenmp" } */ + +int x = 6; + +void +foo () +{ + int v; + #pragma omp atomic seq_cst load /* { dg-error "expected end of line" } */ + v = x; /* { dg-error "invalid form" } */ + #pragma omp atomic seq_cst, load /* { dg-error "expected end of line" } */ + v = x; /* { dg-error "invalid form" } */ + #pragma omp atomic seq_cst store /* { dg-error "expected end of line" } */ + x = v; /* { dg-error "invalid form" } */ + #pragma omp atomic seq_cst ,store /* { dg-error "expected end of line" } */ + x = v; /* { dg-error "invalid form" } */ + #pragma omp atomic seq_cst update /* { dg-error "expected end of line" } */ + x += v; + #pragma omp atomic seq_cst , update /* { dg-error "expected end of line" } */ + x += v; + #pragma omp atomic seq_cst capture /* { dg-error "expected end of line" } */ + v = x += 2; /* { dg-error "invalid form" } */ + #pragma omp atomic seq_cst, capture /* { dg-error "expected end of line" } */ + v = x += 2; /* { dg-error "invalid form" } */ + #pragma omp atomic load , seq_cst /* { dg-error "expected end of line" } */ + v = x; /* { dg-error "invalid form" } */ + #pragma omp atomic store ,seq_cst /* { dg-error "expected end of line" } */ + x = v; /* { dg-error "invalid form" } */ + #pragma omp atomic update, seq_cst /* { dg-error "expected end of line" } */ + x += v; + #pragma omp atomic capture, seq_cst /* { dg-error "expected end of line" } */ + v = x += 2; +} --- libgomp/testsuite/libgomp.c++/atomic-14.C.jj 2013-04-30 18:03:33.000000000 +0200 +++ libgomp/testsuite/libgomp.c++/atomic-14.C 2013-07-03 18:36:49.661658835 +0200 @@ -13,13 +13,13 @@ main () v = x; if (v != 3) abort (); - #pragma omp atomic seq_cst update + #pragma omp atomic update seq_cst x = 3 * 2 * 1 + x; - #pragma omp atomic read, seq_cst + #pragma omp atomic read seq_cst v = x; if (v != 9) abort (); - #pragma omp atomic seq_cst, capture + #pragma omp atomic capture seq_cst v = x = x | 16; if (v != 25) abort (); @@ -27,15 +27,15 @@ main () v = x = x + 14 * 2 / 4; if (v != 32) abort (); - #pragma omp atomic seq_cst capture + #pragma omp atomic capture seq_cst v = x = 5 | x; if (v != 37) abort (); - #pragma omp atomic capture, seq_cst + #pragma omp atomic capture seq_cst v = x = 40 + 12 - 2 - 7 - x; if (v != 6) abort (); - #pragma omp atomic seq_cst read + #pragma omp atomic read seq_cst v = x; if (v != 6) abort (); @@ -43,7 +43,7 @@ main () { v = x; x = 3 + x; } if (v != 6) abort (); - #pragma omp atomic seq_cst capture + #pragma omp atomic capture seq_cst { v = x; x = -1 * -1 * -1 * -1 - x; } if (v != 9) abort (); @@ -51,11 +51,11 @@ main () v = x; if (v != -8) abort (); - #pragma omp atomic capture, seq_cst + #pragma omp atomic capture seq_cst { x = 2 * 2 - x; v = x; } if (v != 12) abort (); - #pragma omp atomic seq_cst capture + #pragma omp atomic capture seq_cst { x = 7 & x; v = x; } if (v != 4) abort (); @@ -63,7 +63,7 @@ main () { v = x; x = 6; } if (v != 4) abort (); - #pragma omp atomic read, seq_cst + #pragma omp atomic read seq_cst v = x; if (v != 6) abort (); @@ -71,11 +71,11 @@ main () { v = x; x = 7 * 8 + 23; } if (v != 6) abort (); - #pragma omp atomic seq_cst, read + #pragma omp atomic read seq_cst v = x; if (v != 79) abort (); - #pragma omp atomic capture , seq_cst + #pragma omp atomic capture seq_cst { v = x; x = 23 + 6 * 4; } if (v != 79) abort (); @@ -83,7 +83,7 @@ main () v = x; if (v != 47) abort (); - #pragma omp atomic seq_cst capture + #pragma omp atomic capture seq_cst { v = x; x = l ? 17 : 12; } if (v != 47) abort (); --- libgomp/testsuite/libgomp.c++/atomic-15.C.jj 2013-04-30 18:03:33.000000000 +0200 +++ libgomp/testsuite/libgomp.c++/atomic-15.C 2013-07-03 18:38:06.107417340 +0200 @@ -14,13 +14,13 @@ foo () v = x; if (v != 3) abort (); - #pragma omp atomic seq_cst update + #pragma omp atomic update seq_cst x = 3 * 2 * 1 + x; - #pragma omp atomic read, seq_cst + #pragma omp atomic read seq_cst v = x; if (v != 9) abort (); - #pragma omp atomic seq_cst, capture + #pragma omp atomic capture seq_cst v = x = x | 16; if (v != 25) abort (); @@ -28,15 +28,15 @@ foo () v = x = x + 14 * 2 / 4; if (v != 32) abort (); - #pragma omp atomic seq_cst capture + #pragma omp atomic capture seq_cst v = x = 5 | x; if (v != 37) abort (); - #pragma omp atomic capture, seq_cst + #pragma omp atomic capture seq_cst v = x = 40 + 12 - 2 - 7 - x; if (v != 6) abort (); - #pragma omp atomic seq_cst read + #pragma omp atomic read seq_cst v = x; if (v != 6) abort (); @@ -44,7 +44,7 @@ foo () { v = x; x = 3 + x; } if (v != 6) abort (); - #pragma omp atomic seq_cst capture + #pragma omp atomic capture seq_cst { v = x; x = -1 * -1 * -1 * -1 - x; } if (v != 9) abort (); @@ -52,11 +52,11 @@ foo () v = x; if (v != -8) abort (); - #pragma omp atomic capture, seq_cst + #pragma omp atomic capture seq_cst { x = 2 * 2 - x; v = x; } if (v != 12) abort (); - #pragma omp atomic seq_cst capture + #pragma omp atomic capture seq_cst { x = 7 & x; v = x; } if (v != 4) abort (); @@ -64,7 +64,7 @@ foo () { v = x; x = 6; } if (v != 4) abort (); - #pragma omp atomic read, seq_cst + #pragma omp atomic read seq_cst v = x; if (v != 6) abort (); @@ -72,11 +72,11 @@ foo () { v = x; x = 7 * 8 + 23; } if (v != 6) abort (); - #pragma omp atomic seq_cst, read + #pragma omp atomic read seq_cst v = x; if (v != 79) abort (); - #pragma omp atomic capture , seq_cst + #pragma omp atomic capture seq_cst { v = x; x = 23 + 6 * 4; } if (v != 79) abort (); @@ -84,7 +84,7 @@ foo () v = x; if (v != 47) abort (); - #pragma omp atomic seq_cst capture + #pragma omp atomic capture seq_cst { v = x; x = l ? 17 : 12; } if (v != 47) abort (); --- libgomp/testsuite/libgomp.c/atomic-17.c.jj 2013-04-30 18:03:33.000000000 +0200 +++ libgomp/testsuite/libgomp.c/atomic-17.c 2013-07-03 18:39:04.783423739 +0200 @@ -13,13 +13,13 @@ main () v = x; if (v != 3) abort (); - #pragma omp atomic seq_cst update + #pragma omp atomic update seq_cst x = 3 * 2 * 1 + x; - #pragma omp atomic read, seq_cst + #pragma omp atomic read seq_cst v = x; if (v != 9) abort (); - #pragma omp atomic seq_cst, capture + #pragma omp atomic capture seq_cst v = x = x | 16; if (v != 25) abort (); @@ -27,15 +27,15 @@ main () v = x = x + 14 * 2 / 4; if (v != 32) abort (); - #pragma omp atomic seq_cst capture + #pragma omp atomic capture seq_cst v = x = 5 | x; if (v != 37) abort (); - #pragma omp atomic capture, seq_cst + #pragma omp atomic capture seq_cst v = x = 40 + 12 - 2 - 7 - x; if (v != 6) abort (); - #pragma omp atomic seq_cst read + #pragma omp atomic read seq_cst v = x; if (v != 6) abort (); @@ -43,7 +43,7 @@ main () { v = x; x = 3 + x; } if (v != 6) abort (); - #pragma omp atomic seq_cst capture + #pragma omp atomic capture seq_cst { v = x; x = -1 * -1 * -1 * -1 - x; } if (v != 9) abort (); @@ -51,11 +51,11 @@ main () v = x; if (v != -8) abort (); - #pragma omp atomic capture, seq_cst + #pragma omp atomic capture seq_cst { x = 2 * 2 - x; v = x; } if (v != 12) abort (); - #pragma omp atomic seq_cst capture + #pragma omp atomic capture seq_cst { x = 7 & x; v = x; } if (v != 4) abort (); @@ -63,7 +63,7 @@ main () { v = x; x = 6; } if (v != 4) abort (); - #pragma omp atomic read, seq_cst + #pragma omp atomic read seq_cst v = x; if (v != 6) abort (); @@ -71,11 +71,11 @@ main () { v = x; x = 7 * 8 + 23; } if (v != 6) abort (); - #pragma omp atomic seq_cst, read + #pragma omp atomic read seq_cst v = x; if (v != 79) abort (); - #pragma omp atomic capture , seq_cst + #pragma omp atomic capture seq_cst { v = x; x = 23 + 6 * 4; } if (v != 79) abort (); @@ -83,7 +83,7 @@ main () v = x; if (v != 47) abort (); - #pragma omp atomic seq_cst capture + #pragma omp atomic capture seq_cst { v = x; x = l ? 17 : 12; } if (v != 47) abort ();