From patchwork Sat Sep 18 08:01:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 45154 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CAF28385AC31 for ; Sat, 18 Sep 2021 08:01:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CAF28385AC31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1631952104; bh=qiaxLS9kZMDUQ/teveMUUzVlh2syAC01R40oOWTdnYs=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=j+x2kT4p7NFhniKW+CaT7wYMoKljwK9pRp5Gon4wK9O7CWowDFHb1bZ7H8wjmkH7F 2K+jiVvY47mUNLgZB/KQmHZ/DS+KPLtQtycOfYBkIJDDT3PqT25SXptw+LnM7Ci4r/ QT8vyIQ1/mmJQe1bQWadFSJ6jfeTvfWOjOKPomuU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 0F69C3858429 for ; Sat, 18 Sep 2021 08:01:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0F69C3858429 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-308-Wd1JXryAPhy7nAJX9o6eZA-1; Sat, 18 Sep 2021 04:01:06 -0400 X-MC-Unique: Wd1JXryAPhy7nAJX9o6eZA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CEEB21808308; Sat, 18 Sep 2021 08:01:05 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D27895D9C6; Sat, 18 Sep 2021 08:01:04 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 18I812b13137998 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sat, 18 Sep 2021 10:01:02 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 18I811MM3137986; Sat, 18 Sep 2021 10:01:01 +0200 Date: Sat, 18 Sep 2021 10:01:01 +0200 To: gcc-patches@gcc.gnu.org Subject: openmp: Allow private or firstprivate arguments to default clause even for C/C++ Message-ID: <20210918080101.GW304296@tucnak> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Cc: Tobias Burnus Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi! OpenMP 5.1 allows default(private) or default(firstprivate) even in C/C++, but it behaves the same way as in Fortran only for variables not declared at namespace or file scope. For the namespace/file scope variables it instead behaves as default(none). Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk. 2021-09-18 Jakub Jelinek gcc/ * gimplify.c (omp_default_clause): For C/C++ default({,first}private), if file/namespace scope variable doesn't have predetermined sharing, treat it as if there was default(none). gcc/c/ * c-parser.c (c_parser_omp_clause_default): Handle private and firstprivate arguments, adjust diagnostics on unknown argument. gcc/cp/ * parser.c (cp_parser_omp_clause_default): Handle private and firstprivate arguments, adjust diagnostics on unknown argument. * cp-gimplify.c (cxx_omp_finish_clause): Handle OMP_CLAUSE_PRIVATE. gcc/testsuite/ * c-c++-common/gomp/default-2.c: New test. * c-c++-common/gomp/default-3.c: New test. * g++.dg/gomp/default-1.C: New test. libgomp/ * testsuite/libgomp.c++/default-1.C: New test. * testsuite/libgomp.c-c++-common/default-1.c: New test. * libgomp.texi (OpenMP 5.1): Mark "private and firstprivate argument to default clause in C and C++" as implemented. Jakub --- gcc/gimplify.c.jj 2021-09-14 10:36:41.351390039 +0200 +++ gcc/gimplify.c 2021-09-17 15:34:34.983711878 +0200 @@ -7369,6 +7369,18 @@ omp_default_clause (struct gimplify_omp_ default_kind = kind; else if (VAR_P (decl) && TREE_STATIC (decl) && DECL_IN_CONSTANT_POOL (decl)) default_kind = OMP_CLAUSE_DEFAULT_SHARED; + /* For C/C++ default({,first}private), variables with static storage duration + declared in a namespace or global scope and referenced in construct + must be explicitly specified, i.e. acts as default(none). */ + else if ((default_kind == OMP_CLAUSE_DEFAULT_PRIVATE + || default_kind == OMP_CLAUSE_DEFAULT_FIRSTPRIVATE) + && VAR_P (decl) + && is_global_var (decl) + && (DECL_FILE_SCOPE_P (decl) + || (DECL_CONTEXT (decl) + && TREE_CODE (DECL_CONTEXT (decl)) == NAMESPACE_DECL)) + && !lang_GNU_Fortran ()) + default_kind = OMP_CLAUSE_DEFAULT_NONE; switch (default_kind) { --- gcc/c/c-parser.c.jj 2021-09-17 11:28:07.601834144 +0200 +++ gcc/c/c-parser.c 2021-09-17 14:20:15.942866085 +0200 @@ -13420,6 +13420,9 @@ c_parser_omp_clause_copyprivate (c_parse /* OpenMP 2.5: default ( none | shared ) + OpenMP 5.1: + default ( private | firstprivate ) + OpenACC: default ( none | present ) */ @@ -13446,9 +13449,24 @@ c_parser_omp_clause_default (c_parser *p break; case 'p': - if (strcmp ("present", p) != 0 || !is_oacc) + if (is_oacc) + { + if (strcmp ("present", p) != 0) + goto invalid_kind; + kind = OMP_CLAUSE_DEFAULT_PRESENT; + } + else + { + if (strcmp ("private", p) != 0) + goto invalid_kind; + kind = OMP_CLAUSE_DEFAULT_PRIVATE; + } + break; + + case 'f': + if (strcmp ("firstprivate", p) != 0 || is_oacc) goto invalid_kind; - kind = OMP_CLAUSE_DEFAULT_PRESENT; + kind = OMP_CLAUSE_DEFAULT_FIRSTPRIVATE; break; case 's': @@ -13469,7 +13487,8 @@ c_parser_omp_clause_default (c_parser *p if (is_oacc) c_parser_error (parser, "expected % or %"); else - c_parser_error (parser, "expected % or %"); + c_parser_error (parser, "expected %, %, " + "% or %"); } parens.skip_until_found_close (parser); --- gcc/cp/parser.c.jj 2021-09-17 11:28:07.606834074 +0200 +++ gcc/cp/parser.c 2021-09-17 15:44:33.665372845 +0200 @@ -36951,6 +36951,9 @@ cp_parser_omp_clause_collapse (cp_parser /* OpenMP 2.5: default ( none | shared ) + OpenMP 5.1: + default ( private | firstprivate ) + OpenACC: default ( none | present ) */ @@ -36964,7 +36967,12 @@ cp_parser_omp_clause_default (cp_parser matching_parens parens; if (!parens.require_open (parser)) return list; - if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)) + if (!is_oacc && cp_lexer_next_token_is_keyword (parser->lexer, RID_PRIVATE)) + { + kind = OMP_CLAUSE_DEFAULT_PRIVATE; + cp_lexer_consume_token (parser->lexer); + } + else 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); @@ -36983,6 +36991,12 @@ cp_parser_omp_clause_default (cp_parser kind = OMP_CLAUSE_DEFAULT_PRESENT; break; + case 'f': + if (strcmp ("firstprivate", p) != 0 || is_oacc) + goto invalid_kind; + kind = OMP_CLAUSE_DEFAULT_FIRSTPRIVATE; + break; + case 's': if (strcmp ("shared", p) != 0 || is_oacc) goto invalid_kind; @@ -37001,7 +37015,8 @@ cp_parser_omp_clause_default (cp_parser if (is_oacc) cp_parser_error (parser, "expected % or %"); else - cp_parser_error (parser, "expected % or %"); + cp_parser_error (parser, "expected %, %, " + "% or %"); } if (kind == OMP_CLAUSE_DEFAULT_UNSPECIFIED --- gcc/cp/cp-gimplify.c.jj 2021-08-19 11:42:27.308423193 +0200 +++ gcc/cp/cp-gimplify.c 2021-09-17 16:23:59.773400531 +0200 @@ -2060,6 +2060,7 @@ cxx_omp_finish_clause (tree c, gimple_se bool make_shared = false; if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_FIRSTPRIVATE + && OMP_CLAUSE_CODE (c) != OMP_CLAUSE_PRIVATE && (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_LASTPRIVATE || !OMP_CLAUSE_LASTPRIVATE_LOOP_IV (c))) return; @@ -2080,9 +2081,10 @@ cxx_omp_finish_clause (tree c, gimple_se Save the results, because later we won't be in the right context for making these queries. */ bool first = OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FIRSTPRIVATE; + bool last = OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE; if (!make_shared && CLASS_TYPE_P (inner_type) - && cxx_omp_create_clause_info (c, inner_type, !first, first, !first, + && cxx_omp_create_clause_info (c, inner_type, !first, first, last, true)) make_shared = true; --- gcc/testsuite/c-c++-common/gomp/default-2.c.jj 2021-09-17 15:08:21.372642146 +0200 +++ gcc/testsuite/c-c++-common/gomp/default-2.c 2021-09-17 16:00:47.658804547 +0200 @@ -0,0 +1,67 @@ +int x; +extern int z; + +void +foo (void) +{ + int y = 0, i; + static int w; + #pragma omp task default(firstprivate) /* { dg-message "note: enclosing 'task'" } */ + { + y++; /* { dg-bogus "'y' not specified in enclosing 'task'" } */ + w++; /* { dg-bogus "'w' not specified in enclosing 'task'" } */ + x++; /* { dg-error "'x' not specified in enclosing 'task'" } */ + z++; /* { dg-error "'z' not specified in enclosing 'task'" } */ + } + #pragma omp taskloop default(firstprivate) /* { dg-message "note: enclosing 'taskloop'" } */ + for (i = 0; i < 64; i++) + { + y++; /* { dg-bogus "'y' not specified in enclosing 'taskloop'" } */ + w++; /* { dg-bogus "'w' not specified in enclosing 'taskloop'" } */ + x++; /* { dg-error "'x' not specified in enclosing 'taskloop'" } */ + z++; /* { dg-error "'z' not specified in enclosing 'taskloop'" } */ + } + #pragma omp teams default(firstprivate) /* { dg-message "note: enclosing 'teams'" } */ + { + y++; /* { dg-bogus "'y' not specified in enclosing 'teams'" } */ + w++; /* { dg-bogus "'w' not specified in enclosing 'teams'" } */ + x++; /* { dg-error "'x' not specified in enclosing 'teams'" } */ + z++; /* { dg-error "'z' not specified in enclosing 'teams'" } */ + } + #pragma omp parallel default(firstprivate) /* { dg-message "note: enclosing 'parallel'" } */ + { + y++; /* { dg-bogus "'y' not specified in enclosing 'parallel'" } */ + w++; /* { dg-bogus "'w' not specified in enclosing 'parallel'" } */ + x++; /* { dg-error "'x' not specified in enclosing 'parallel'" } */ + z++; /* { dg-error "'z' not specified in enclosing 'parallel'" } */ + } + #pragma omp task default(private) /* { dg-message "note: enclosing 'task'" } */ + { + y = 1; /* { dg-bogus "'y' not specified in enclosing 'task'" } */ + w = 1; /* { dg-bogus "'w' not specified in enclosing 'task'" } */ + x++; /* { dg-error "'x' not specified in enclosing 'task'" } */ + z++; /* { dg-error "'z' not specified in enclosing 'task'" } */ + } + #pragma omp taskloop default(private) /* { dg-message "note: enclosing 'taskloop'" } */ + for (i = 0; i < 64; i++) + { + y = 1; /* { dg-bogus "'y' not specified in enclosing 'taskloop'" } */ + w = 1; /* { dg-bogus "'w' not specified in enclosing 'taskloop'" } */ + x++; /* { dg-error "'x' not specified in enclosing 'taskloop'" } */ + z++; /* { dg-error "'z' not specified in enclosing 'taskloop'" } */ + } + #pragma omp teams default(private) /* { dg-message "note: enclosing 'teams'" } */ + { + y = 1; /* { dg-bogus "'y' not specified in enclosing 'teams'" } */ + w = 1; /* { dg-bogus "'w' not specified in enclosing 'teams'" } */ + x++; /* { dg-error "'x' not specified in enclosing 'teams'" } */ + z++; /* { dg-error "'z' not specified in enclosing 'teams'" } */ + } + #pragma omp parallel default(private) /* { dg-message "note: enclosing 'parallel'" } */ + { + y = 1; /* { dg-bogus "'y' not specified in enclosing 'parallel'" } */ + w++; /* { dg-bogus "'w' not specified in enclosing 'parallel'" } */ + x++; /* { dg-error "'x' not specified in enclosing 'parallel'" } */ + z++; /* { dg-error "'z' not specified in enclosing 'parallel'" } */ + } +} --- gcc/testsuite/c-c++-common/gomp/default-3.c.jj 2021-09-17 15:15:35.102596355 +0200 +++ gcc/testsuite/c-c++-common/gomp/default-3.c 2021-09-17 15:15:30.164665184 +0200 @@ -0,0 +1,14 @@ +void +foo (void) +{ + int i; + #pragma omp task default(copyprivate) /* { dg-error "expected 'none', 'shared', 'private' or 'firstprivate' before 'copyprivate'" } */ + ; + #pragma omp taskloop default(copyprivate) /* { dg-error "expected 'none', 'shared', 'private' or 'firstprivate' before 'copyprivate'" } */ + for (i = 0; i < 64; i++) + ; + #pragma omp teams default(copyprivate) /* { dg-error "expected 'none', 'shared', 'private' or 'firstprivate' before 'copyprivate'" } */ + ; + #pragma omp parallel default(copyprivate) /* { dg-error "expected 'none', 'shared', 'private' or 'firstprivate' before 'copyprivate'" } */ + ; +} --- gcc/testsuite/g++.dg/gomp/default-1.C.jj 2021-09-17 15:48:54.737736963 +0200 +++ gcc/testsuite/g++.dg/gomp/default-1.C 2021-09-17 15:59:24.339965798 +0200 @@ -0,0 +1,112 @@ +namespace N +{ + int x; + extern int z; +} + +struct S +{ + static int s; +}; + +#if __cpp_variable_templates >= 201304 +template +int t = N; +#endif + +void +foo (void) +{ + int y = 0, i; + static int w; + #pragma omp task default(firstprivate) /* { dg-message "note: enclosing 'task'" } */ + { + y++; /* { dg-bogus "'y' not specified in enclosing 'task'" } */ + w++; /* { dg-bogus "'w' not specified in enclosing 'task'" } */ + S::s++; /* { dg-bogus "'S::s' not specified in enclosing 'task'" } */ + N::x++; /* { dg-error "'x' not specified in enclosing 'task'" } */ + N::z++; /* { dg-error "'z' not specified in enclosing 'task'" } */ +#if __cpp_variable_templates >= 201304 + t<5>++; /* { dg-error "'t' not specified in enclosing 'task'" "" { target c++14 } } */ +#endif + } + #pragma omp taskloop default(firstprivate) /* { dg-message "note: enclosing 'taskloop'" } */ + for (i = 0; i < 64; i++) + { + y++; /* { dg-bogus "'y' not specified in enclosing 'taskloop'" } */ + w++; /* { dg-bogus "'w' not specified in enclosing 'taskloop'" } */ + S::s++; /* { dg-bogus "'S::s' not specified in enclosing 'taskloop'" } */ + N::x++; /* { dg-error "'x' not specified in enclosing 'taskloop'" } */ + N::z++; /* { dg-error "'z' not specified in enclosing 'taskloop'" } */ +#if __cpp_variable_templates >= 201304 + t<5>++; /* { dg-error "'t' not specified in enclosing 'taskloop'" "" { target c++14 } } */ +#endif + } + #pragma omp teams default(firstprivate) /* { dg-message "note: enclosing 'teams'" } */ + { + y++; /* { dg-bogus "'y' not specified in enclosing 'teams'" } */ + w++; /* { dg-bogus "'w' not specified in enclosing 'teams'" } */ + S::s++; /* { dg-bogus "'S::s' not specified in enclosing 'teams'" } */ + N::x++; /* { dg-error "'x' not specified in enclosing 'teams'" } */ + N::z++; /* { dg-error "'z' not specified in enclosing 'teams'" } */ +#if __cpp_variable_templates >= 201304 + t<5>++; /* { dg-error "'t' not specified in enclosing 'teams'" "" { target c++14 } } */ +#endif + } + #pragma omp parallel default(firstprivate) /* { dg-message "note: enclosing 'parallel'" } */ + { + y++; /* { dg-bogus "'y' not specified in enclosing 'parallel'" } */ + w++; /* { dg-bogus "'w' not specified in enclosing 'parallel'" } */ + S::s++; /* { dg-bogus "'S::s' not specified in enclosing 'parallel'" } */ + N::x++; /* { dg-error "'x' not specified in enclosing 'parallel'" } */ + N::z++; /* { dg-error "'z' not specified in enclosing 'parallel'" } */ +#if __cpp_variable_templates >= 201304 + t<5>++; /* { dg-error "'t' not specified in enclosing 'parallel'" "" { target c++14 } } */ +#endif + } + #pragma omp task default(private) /* { dg-message "note: enclosing 'task'" } */ + { + y = 1; /* { dg-bogus "'y' not specified in enclosing 'task'" } */ + w = 1; /* { dg-bogus "'w' not specified in enclosing 'task'" } */ + S::s = 1; /* { dg-bogus "'S::s' not specified in enclosing 'task'" } */ + N::x++; /* { dg-error "'x' not specified in enclosing 'task'" } */ + N::z++; /* { dg-error "'z' not specified in enclosing 'task'" } */ +#if __cpp_variable_templates >= 201304 + t<5>++; /* { dg-error "'t' not specified in enclosing 'task'" "" { target c++14 } } */ +#endif + } + #pragma omp taskloop default(private) /* { dg-message "note: enclosing 'taskloop'" } */ + for (i = 0; i < 64; i++) + { + y = 1; /* { dg-bogus "'y' not specified in enclosing 'taskloop'" } */ + w = 1; /* { dg-bogus "'w' not specified in enclosing 'taskloop'" } */ + S::s = 1; /* { dg-bogus "'S::s' not specified in enclosing 'taskloop'" } */ + N::x++; /* { dg-error "'x' not specified in enclosing 'taskloop'" } */ + N::z++; /* { dg-error "'z' not specified in enclosing 'taskloop'" } */ +#if __cpp_variable_templates >= 201304 + t<5>++; /* { dg-error "'t' not specified in enclosing 'taskloop'" "" { target c++14 } } */ +#endif + } + #pragma omp teams default(private) /* { dg-message "note: enclosing 'teams'" } */ + { + y = 1; /* { dg-bogus "'y' not specified in enclosing 'teams'" } */ + w = 1; /* { dg-bogus "'w' not specified in enclosing 'teams'" } */ + S::s = 1; /* { dg-bogus "'S::s' not specified in enclosing 'teams'" } */ + N::x++; /* { dg-error "'x' not specified in enclosing 'teams'" } */ + N::z++; /* { dg-error "'z' not specified in enclosing 'teams'" } */ +#if __cpp_variable_templates >= 201304 + t<5>++; /* { dg-error "'t' not specified in enclosing 'teams'" "" { target c++14 } } */ +#endif + } + #pragma omp parallel default(private) /* { dg-message "note: enclosing 'parallel'" } */ + { + y = 1; /* { dg-bogus "'y' not specified in enclosing 'parallel'" } */ + w = 1; /* { dg-bogus "'w' not specified in enclosing 'parallel'" } */ + S::s = 1; /* { dg-bogus "'S::s' not specified in enclosing 'parallel'" } */ + N::x++; /* { dg-error "'x' not specified in enclosing 'parallel'" } */ + N::z++; /* { dg-error "'z' not specified in enclosing 'parallel'" } */ +#if __cpp_variable_templates >= 201304 + t<5>++; /* { dg-error "'t' not specified in enclosing 'parallel'" "" { target c++14 } } */ +#endif + } +} --- libgomp/testsuite/libgomp.c++/default-1.C.jj 2021-09-17 16:07:13.222430760 +0200 +++ libgomp/testsuite/libgomp.c++/default-1.C 2021-09-17 16:25:31.411123142 +0200 @@ -0,0 +1,29 @@ +#include +#include + +struct S { S () : s (42) {} S (const S &x) : s (x.s) {}; ~S () {} int s; }; + +int +main () +{ + S s; + s.s = 113; + #pragma omp parallel num_threads(4) default(firstprivate) + { + if (s.s != 113) + abort (); + s.s = omp_get_thread_num (); + #pragma omp barrier + if (s.s != omp_get_thread_num ()) + abort (); + } + #pragma omp parallel num_threads(4) default(private) + { + if (s.s != 42) + abort (); + s.s = omp_get_thread_num () + 13; + #pragma omp barrier + if (s.s != omp_get_thread_num () + 13) + abort (); + } +} --- libgomp/testsuite/libgomp.c-c++-common/default-1.c.jj 2021-09-17 16:04:30.546698051 +0200 +++ libgomp/testsuite/libgomp.c-c++-common/default-1.c 2021-09-17 16:04:23.713793285 +0200 @@ -0,0 +1,25 @@ +#include +#include + +int +main () +{ + int v = 42; + #pragma omp parallel num_threads(4) default(firstprivate) + { + if (v != 42) + abort (); + v = omp_get_thread_num (); + #pragma omp barrier + if (v != omp_get_thread_num ()) + abort (); + } + #pragma omp parallel num_threads(4) default(private) + { + v = omp_get_thread_num () + 13; + #pragma omp barrier + if (v != omp_get_thread_num () + 13) + abort (); + } + return 0; +} --- libgomp/libgomp.texi.jj 2021-09-17 12:33:32.557050348 +0200 +++ libgomp/libgomp.texi 2021-09-17 16:08:14.417577856 +0200 @@ -305,7 +305,7 @@ The OpenMP 4.5 specification is fully su @item @code{seq_cst} clause on a @code{flush} construct @tab Y @tab @item @code{inoutset} argument to the @code{depend} clause @tab N @tab @item @code{private} and @code{firstprivate} argument to @code{default} - clause in C and C++ @tab N @tab + clause in C and C++ @tab Y @tab @item @code{present} argument to @code{defaultmap} clause @tab N @tab @item @code{omp_set_num_teams}, @code{omp_set_teams_thread_limit}, @code{omp_get_max_teams}, @code{omp_get_teams_thread_limit} runtime