From b42a67677cd80a0f2da6c75e38c5dfcbb5e913fa Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 22 Dec 2015 12:44:46 +0000 Subject: [PATCH] [OPENMP] Revert r256238 to fix the problem with tests on Linux. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256239 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticSemaKinds.td | 10 - include/clang/Basic/OpenMPKinds.def | 1 - include/clang/Sema/Sema.h | 6 +- lib/CodeGen/CGOpenMPRuntime.cpp | 1 - lib/Sema/SemaOpenMP.cpp | 224 ++++----------------- lib/Sema/TreeTransform.h | 5 - test/OpenMP/ordered_ast_print.cpp | 9 +- test/OpenMP/ordered_messages.cpp | 49 +---- 8 files changed, 55 insertions(+), 250 deletions(-) diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index d4c77de089..3c7280d76e 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -7951,16 +7951,6 @@ def err_omp_firstprivate_distribute_in_teams_reduction : Error< "reduction variable in '#pragma omp teams' cannot be firstprivate in '#pragma omp distribute'">; def err_omp_depend_clause_thread_simd : Error< "'depend' clauses cannot be mixed with '%0' clause">; -def err_omp_depend_sink_wrong_expr : Error< - "expected expression form x[+-d], where x is the loop iteration variable and d is a constant non-negative integer">; -def err_omp_depend_sink_expected_loop_iteration : Error< - "expected %0 loop iteration variable">; -def err_omp_depend_sink_unexpected_expr : Error< - "unexpected expression: number of expressions is larger than the number of associated loops">; -def err_omp_depend_sink_expected_plus_minus : Error< - "expected '+' or '-' operation">; -def err_omp_depend_sink_source_not_allowed : Error< - "'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">; } // end of OpenMP category let CategoryName = "Related Result Type Issue" in { diff --git a/include/clang/Basic/OpenMPKinds.def b/include/clang/Basic/OpenMPKinds.def index 8b8e5bf6c9..628a998453 100644 --- a/include/clang/Basic/OpenMPKinds.def +++ b/include/clang/Basic/OpenMPKinds.def @@ -255,7 +255,6 @@ OPENMP_DEPEND_KIND(in) OPENMP_DEPEND_KIND(out) OPENMP_DEPEND_KIND(inout) OPENMP_DEPEND_KIND(source) -OPENMP_DEPEND_KIND(sink) // Modifiers for 'linear' clause. OPENMP_LINEAR_KIND(val) diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index df246c0482..94fd00bf02 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -7760,10 +7760,8 @@ private: /// \brief Initialization of data-sharing attributes stack. void InitDataSharingAttributesStack(); void DestroyDataSharingAttributesStack(); - ExprResult - VerifyPositiveIntegerConstantInClause(Expr *Op, OpenMPClauseKind CKind, - bool StrictlyPositive = true); - + ExprResult VerifyPositiveIntegerConstantInClause(Expr *Op, + OpenMPClauseKind CKind); public: /// \brief Return true if the provided declaration \a VD should be captured by /// reference in the provided scope \a RSI. This will take into account the diff --git a/lib/CodeGen/CGOpenMPRuntime.cpp b/lib/CodeGen/CGOpenMPRuntime.cpp index 0ba7e0639a..f9e5adca12 100644 --- a/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/lib/CodeGen/CGOpenMPRuntime.cpp @@ -2556,7 +2556,6 @@ void CGOpenMPRuntime::emitTaskCall( DepKind = DepInOut; break; case OMPC_DEPEND_source: - case OMPC_DEPEND_sink: case OMPC_DEPEND_unknown: llvm_unreachable("Unknown task dependence type"); } diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp index 0ee0c3c939..83329350f2 100644 --- a/lib/Sema/SemaOpenMP.cpp +++ b/lib/Sema/SemaOpenMP.cpp @@ -89,7 +89,7 @@ private: }; typedef llvm::SmallDenseMap DeclSAMapTy; typedef llvm::SmallDenseMap AlignedMapTy; - typedef llvm::DenseMap LoopControlVariablesMapTy; + typedef llvm::DenseSet LoopControlVariablesSetTy; typedef llvm::SmallDenseMap MappedDeclsTy; typedef llvm::StringMap> CriticalsWithHintsTy; @@ -98,7 +98,7 @@ private: DeclSAMapTy SharingMap; AlignedMapTy AlignedMap; MappedDeclsTy MappedDecls; - LoopControlVariablesMapTy LCVMap; + LoopControlVariablesSetTy LCVSet; DefaultDataSharingAttributes DefaultAttr; SourceLocation DefaultAttrLoc; OpenMPDirectiveKind Directive; @@ -115,12 +115,12 @@ private: SourceLocation InnerTeamsRegionLoc; SharingMapTy(OpenMPDirectiveKind DKind, DeclarationNameInfo Name, Scope *CurScope, SourceLocation Loc) - : SharingMap(), AlignedMap(), LCVMap(), DefaultAttr(DSA_unspecified), + : SharingMap(), AlignedMap(), LCVSet(), DefaultAttr(DSA_unspecified), Directive(DKind), DirectiveName(std::move(Name)), CurScope(CurScope), ConstructLoc(Loc), OrderedRegion(), NowaitRegion(false), CancelRegion(false), CollapseNumber(1), InnerTeamsRegionLoc() {} SharingMapTy() - : SharingMap(), AlignedMap(), LCVMap(), DefaultAttr(DSA_unspecified), + : SharingMap(), AlignedMap(), LCVSet(), DefaultAttr(DSA_unspecified), Directive(OMPD_unknown), DirectiveName(), CurScope(nullptr), ConstructLoc(), OrderedRegion(), NowaitRegion(false), CancelRegion(false), CollapseNumber(1), InnerTeamsRegionLoc() {} @@ -185,17 +185,7 @@ public: void addLoopControlVariable(VarDecl *D); /// \brief Check if the specified variable is a loop control variable for /// current region. - /// \return The index of the loop control variable in the list of associated - /// for-loops (from outer to inner). - unsigned isLoopControlVariable(VarDecl *D); - /// \brief Check if the specified variable is a loop control variable for - /// parent region. - /// \return The index of the loop control variable in the list of associated - /// for-loops (from outer to inner). - unsigned isParentLoopControlVariable(VarDecl *D); - /// \brief Get the loop control variable for the I-th loop (or nullptr) in - /// parent directive. - VarDecl *getParentLoopControlVariable(unsigned I); + bool isLoopControlVariable(VarDecl *D); /// \brief Adds explicit data sharing attribute to the specified declaration. void addDSA(VarDecl *D, DeclRefExpr *E, OpenMPClauseKind A); @@ -496,32 +486,13 @@ DeclRefExpr *DSAStackTy::addUniqueAligned(VarDecl *D, DeclRefExpr *NewDE) { void DSAStackTy::addLoopControlVariable(VarDecl *D) { assert(Stack.size() > 1 && "Data-sharing attributes stack is empty"); D = D->getCanonicalDecl(); - Stack.back().LCVMap[D] = Stack.back().LCVMap.size() + 1; + Stack.back().LCVSet.insert(D); } -unsigned DSAStackTy::isLoopControlVariable(VarDecl *D) { +bool DSAStackTy::isLoopControlVariable(VarDecl *D) { assert(Stack.size() > 1 && "Data-sharing attributes stack is empty"); D = D->getCanonicalDecl(); - return Stack.back().LCVMap.count(D) > 0 ? Stack.back().LCVMap[D] : 0; -} - -unsigned DSAStackTy::isParentLoopControlVariable(VarDecl *D) { - assert(Stack.size() > 2 && "Data-sharing attributes stack is empty"); - D = D->getCanonicalDecl(); - return Stack[Stack.size() - 2].LCVMap.count(D) > 0 - ? Stack[Stack.size() - 2].LCVMap[D] - : 0; -} - -VarDecl *DSAStackTy::getParentLoopControlVariable(unsigned I) { - assert(Stack.size() > 2 && "Data-sharing attributes stack is empty"); - if (Stack[Stack.size() - 2].LCVMap.size() < I) - return nullptr; - for (auto &Pair : Stack[Stack.size() - 2].LCVMap) { - if (Pair.second == I) - return Pair.first; - } - return nullptr; + return Stack.back().LCVSet.count(D) > 0; } void DSAStackTy::addDSA(VarDecl *D, DeclRefExpr *E, OpenMPClauseKind A) { @@ -4605,7 +4576,6 @@ StmtResult Sema::ActOnOpenMPOrderedDirective(ArrayRef Clauses, SourceLocation EndLoc) { OMPClause *DependFound = nullptr; OMPClause *DependSourceClause = nullptr; - OMPClause *DependSinkClause = nullptr; bool ErrorFound = false; OMPThreadsClause *TC = nullptr; OMPSIMDClause *SC = nullptr; @@ -4620,18 +4590,6 @@ StmtResult Sema::ActOnOpenMPOrderedDirective(ArrayRef Clauses, ErrorFound = true; } else DependSourceClause = C; - if (DependSinkClause) { - Diag(C->getLocStart(), diag::err_omp_depend_sink_source_not_allowed) - << 0; - ErrorFound = true; - } - } else if (DC->getDependencyKind() == OMPC_DEPEND_sink) { - if (DependSourceClause) { - Diag(C->getLocStart(), diag::err_omp_depend_sink_source_not_allowed) - << 1; - ErrorFound = true; - } - DependSinkClause = C; } } else if (C->getClauseKind() == OMPC_threads) TC = cast(C); @@ -5795,8 +5753,7 @@ OMPClause *Sema::ActOnOpenMPNumThreadsClause(Expr *NumThreads, } ExprResult Sema::VerifyPositiveIntegerConstantInClause(Expr *E, - OpenMPClauseKind CKind, - bool StrictlyPositive) { + OpenMPClauseKind CKind) { if (!E) return ExprError(); if (E->isValueDependent() || E->isTypeDependent() || @@ -5806,11 +5763,9 @@ ExprResult Sema::VerifyPositiveIntegerConstantInClause(Expr *E, ExprResult ICE = VerifyIntegerConstantExpression(E, &Result); if (ICE.isInvalid()) return ExprError(); - if ((StrictlyPositive && !Result.isStrictlyPositive()) || - (!StrictlyPositive && !Result.isNonNegative())) { + if (!Result.isStrictlyPositive()) { Diag(E->getExprLoc(), diag::err_omp_negative_expression_in_clause) - << getOpenMPClauseName(CKind) << (StrictlyPositive ? 1 : 0) - << E->getSourceRange(); + << getOpenMPClauseName(CKind) << 1 << E->getSourceRange(); return ExprError(); } if (CKind == OMPC_aligned && !Result.isPowerOf2()) { @@ -8035,32 +7990,29 @@ Sema::ActOnOpenMPDependClause(OpenMPDependClauseKind DepKind, ArrayRef VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) { if (DSAStack->getCurrentDirective() == OMPD_ordered && - DepKind != OMPC_DEPEND_source && DepKind != OMPC_DEPEND_sink) { + DepKind != OMPC_DEPEND_source) { std::string Values = "'"; Values += getOpenMPSimpleClauseTypeName(OMPC_depend, OMPC_DEPEND_source); - Values += "' or '"; - Values += getOpenMPSimpleClauseTypeName(OMPC_depend, OMPC_DEPEND_sink); Values += "'"; Diag(DepLoc, diag::err_omp_unexpected_clause_value) << Values << getOpenMPClauseName(OMPC_depend); return nullptr; } if (DSAStack->getCurrentDirective() != OMPD_ordered && - (DepKind == OMPC_DEPEND_unknown || DepKind == OMPC_DEPEND_source || - DepKind == OMPC_DEPEND_sink)) { + (DepKind == OMPC_DEPEND_unknown || DepKind == OMPC_DEPEND_source)) { std::string Values; std::string Sep(", "); for (unsigned i = 0; i < OMPC_DEPEND_unknown; ++i) { - if (i == OMPC_DEPEND_source || i == OMPC_DEPEND_sink) + if (i == OMPC_DEPEND_source) continue; Values += "'"; Values += getOpenMPSimpleClauseTypeName(OMPC_depend, i); Values += "'"; switch (i) { - case OMPC_DEPEND_unknown - 4: + case OMPC_DEPEND_unknown - 3: Values += " or "; break; - case OMPC_DEPEND_unknown - 3: + case OMPC_DEPEND_unknown - 2: break; default: Values += Sep; @@ -8072,128 +8024,38 @@ Sema::ActOnOpenMPDependClause(OpenMPDependClauseKind DepKind, return nullptr; } SmallVector Vars; - llvm::APSInt DepCounter(/*BitWidth=*/32); - llvm::APSInt TotalDepCount(/*BitWidth=*/32); - if (DepKind == OMPC_DEPEND_sink) { - if (auto *OrderedCountExpr = DSAStack->getParentOrderedRegionParam()) { - TotalDepCount = OrderedCountExpr->EvaluateKnownConstInt(Context); - TotalDepCount.setIsUnsigned(/*Val=*/true); - } - } - if ((DepKind != OMPC_DEPEND_sink && DepKind != OMPC_DEPEND_source) || - DSAStack->getParentOrderedRegionParam()) { - for (auto &RefExpr : VarList) { - assert(RefExpr && "NULL expr in OpenMP shared clause."); - if (isa(RefExpr) || - (DepKind == OMPC_DEPEND_sink && CurContext->isDependentContext())) { - // It will be analyzed later. - Vars.push_back(RefExpr); - continue; - } - - SourceLocation ELoc = RefExpr->getExprLoc(); - auto *SimpleExpr = RefExpr->IgnoreParenCasts(); - if (DepKind == OMPC_DEPEND_sink) { - if (DepCounter >= TotalDepCount) { - Diag(ELoc, diag::err_omp_depend_sink_unexpected_expr); - continue; - } - ++DepCounter; - // OpenMP [2.13.9, Summary] - // depend(dependence-type : vec), where dependence-type is: - // 'sink' and where vec is the iteration vector, which has the form: - // x1 [+- d1], x2 [+- d2 ], . . . , xn [+- dn] - // where n is the value specified by the ordered clause in the loop - // directive, xi denotes the loop iteration variable of the i-th nested - // loop associated with the loop directive, and di is a constant - // non-negative integer. - SimpleExpr = SimpleExpr->IgnoreImplicit(); - auto *DE = dyn_cast(SimpleExpr); - if (!DE) { - OverloadedOperatorKind OOK = OO_None; - SourceLocation OOLoc; - Expr *LHS, *RHS; - if (auto *BO = dyn_cast(SimpleExpr)) { - OOK = BinaryOperator::getOverloadedOperator(BO->getOpcode()); - OOLoc = BO->getOperatorLoc(); - LHS = BO->getLHS()->IgnoreParenImpCasts(); - RHS = BO->getRHS()->IgnoreParenImpCasts(); - } else if (auto *OCE = dyn_cast(SimpleExpr)) { - OOK = OCE->getOperator(); - OOLoc = OCE->getOperatorLoc(); - LHS = OCE->getArg(/*Arg=*/0)->IgnoreParenImpCasts(); - RHS = OCE->getArg(/*Arg=*/1)->IgnoreParenImpCasts(); - } else if (auto *MCE = dyn_cast(SimpleExpr)) { - OOK = MCE->getMethodDecl() - ->getNameInfo() - .getName() - .getCXXOverloadedOperator(); - OOLoc = MCE->getCallee()->getExprLoc(); - LHS = MCE->getImplicitObjectArgument()->IgnoreParenImpCasts(); - RHS = MCE->getArg(/*Arg=*/0)->IgnoreParenImpCasts(); - } else { - Diag(ELoc, diag::err_omp_depend_sink_wrong_expr); - continue; - } - DE = dyn_cast(LHS); - if (!DE) { - Diag(LHS->getExprLoc(), - diag::err_omp_depend_sink_expected_loop_iteration) - << DSAStack->getParentLoopControlVariable( - DepCounter.getZExtValue()); - continue; - } - if (OOK != OO_Plus && OOK != OO_Minus) { - Diag(OOLoc, diag::err_omp_depend_sink_expected_plus_minus); - continue; - } - ExprResult Res = VerifyPositiveIntegerConstantInClause( - RHS, OMPC_depend, /*StrictlyPositive=*/false); - if (Res.isInvalid()) - continue; - } - auto *VD = dyn_cast(DE->getDecl()); - if (!CurContext->isDependentContext() && - DSAStack->getParentOrderedRegionParam() && - (!VD || DepCounter != DSAStack->isParentLoopControlVariable(VD))) { - Diag(DE->getExprLoc(), - diag::err_omp_depend_sink_expected_loop_iteration) - << DSAStack->getParentLoopControlVariable( - DepCounter.getZExtValue()); - continue; - } - } else { - // OpenMP [2.11.1.1, Restrictions, p.3] - // A variable that is part of another variable (such as a field of a - // structure) but is not an array element or an array section cannot - // appear in a depend clause. - auto *DE = dyn_cast(SimpleExpr); - auto *ASE = dyn_cast(SimpleExpr); - auto *OASE = dyn_cast(SimpleExpr); - if (!RefExpr->IgnoreParenImpCasts()->isLValue() || - (!ASE && !DE && !OASE) || (DE && !isa(DE->getDecl())) || - (ASE && !ASE->getBase()->getType()->isAnyPointerType() && - !ASE->getBase()->getType()->isArrayType())) { - Diag(ELoc, diag::err_omp_expected_var_name_or_array_item) - << RefExpr->getSourceRange(); - continue; - } - } - - Vars.push_back(RefExpr->IgnoreParenImpCasts()); + for (auto &RefExpr : VarList) { + assert(RefExpr && "NULL expr in OpenMP shared clause."); + if (isa(RefExpr)) { + // It will be analyzed later. + Vars.push_back(RefExpr); + continue; } - if (!CurContext->isDependentContext() && DepKind == OMPC_DEPEND_sink && - TotalDepCount > VarList.size() && - DSAStack->getParentOrderedRegionParam()) { - Diag(EndLoc, diag::err_omp_depend_sink_expected_loop_iteration) - << DSAStack->getParentLoopControlVariable(VarList.size() + 1); + SourceLocation ELoc = RefExpr->getExprLoc(); + // OpenMP [2.11.1.1, Restrictions, p.3] + // A variable that is part of another variable (such as a field of a + // structure) but is not an array element or an array section cannot appear + // in a depend clause. + auto *SimpleExpr = RefExpr->IgnoreParenCasts(); + auto *DE = dyn_cast(SimpleExpr); + auto *ASE = dyn_cast(SimpleExpr); + auto *OASE = dyn_cast(SimpleExpr); + if (!RefExpr->IgnoreParenImpCasts()->isLValue() || + (!ASE && !DE && !OASE) || (DE && !isa(DE->getDecl())) || + (ASE && !ASE->getBase()->getType()->isAnyPointerType() && + !ASE->getBase()->getType()->isArrayType())) { + Diag(ELoc, diag::err_omp_expected_var_name_or_array_item) + << RefExpr->getSourceRange(); + continue; } - if (DepKind != OMPC_DEPEND_source && DepKind != OMPC_DEPEND_sink && - Vars.empty()) - return nullptr; + + Vars.push_back(RefExpr->IgnoreParenImpCasts()); } + if (DepKind != OMPC_DEPEND_source && Vars.empty()) + return nullptr; + return OMPDependClause::Create(Context, StartLoc, LParenLoc, EndLoc, DepKind, DepLoc, ColonLoc, Vars); } diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index e28b9dc852..f11f135d46 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -6275,11 +6275,6 @@ TreeTransform::TransformForStmt(ForStmt *S) { if (Init.isInvalid()) return StmtError(); - // In OpenMP loop region loop control variable must be captured and be - // private. Perform analysis of first part (if any). - if (getSema().getLangOpts().OpenMP && Init.isUsable()) - getSema().ActOnOpenMPLoopInitialization(S->getForLoc(), Init.get()); - // Transform the condition ExprResult Cond; VarDecl *ConditionVar = nullptr; diff --git a/test/OpenMP/ordered_ast_print.cpp b/test/OpenMP/ordered_ast_print.cpp index 97fe7007e2..1c68540db6 100644 --- a/test/OpenMP/ordered_ast_print.cpp +++ b/test/OpenMP/ordered_ast_print.cpp @@ -8,7 +8,7 @@ void foo() {} -template +template T tmain (T argc) { T b = argc, c, d, e, f, g; static T a; @@ -45,7 +45,6 @@ T tmain (T argc) { #pragma omp parallel for ordered(1) for (int i =0 ; i < argc; ++i) { #pragma omp ordered depend(source) - #pragma omp ordered depend(sink:i+N) a = 2; } return (0); @@ -85,7 +84,6 @@ T tmain (T argc) { // CHECK-NEXT: #pragma omp parallel for ordered(1) // CHECK-NEXT: for (int i = 0; i < argc; ++i) { // CHECK-NEXT: #pragma omp ordered depend(source) -// CHECK-NEXT: #pragma omp ordered depend(sink : i + 3) // CHECK-NEXT: a = 2; // CHECK-NEXT: } // CHECK: static T a; @@ -122,7 +120,6 @@ T tmain (T argc) { // CHECK-NEXT: #pragma omp parallel for ordered(1) // CHECK-NEXT: for (int i = 0; i < argc; ++i) { // CHECK-NEXT: #pragma omp ordered depend(source) -// CHECK-NEXT: #pragma omp ordered depend(sink : i + N) // CHECK-NEXT: a = 2; // CHECK-NEXT: } @@ -164,7 +161,6 @@ int main (int argc, char **argv) { #pragma omp parallel for ordered(1) for (int i =0 ; i < argc; ++i) { #pragma omp ordered depend(source) - #pragma omp ordered depend(sink: i - 5) a = 2; } // CHECK-NEXT: #pragma omp for ordered @@ -200,10 +196,9 @@ int main (int argc, char **argv) { // CHECK-NEXT: #pragma omp parallel for ordered(1) // CHECK-NEXT: for (int i = 0; i < argc; ++i) { // CHECK-NEXT: #pragma omp ordered depend(source) -// CHECK-NEXT: #pragma omp ordered depend(sink : i - 5) // CHECK-NEXT: a = 2; // CHECK-NEXT: } - return tmain(argc); + return tmain(argc); } #endif diff --git a/test/OpenMP/ordered_messages.cpp b/test/OpenMP/ordered_messages.cpp index 36f9bb2c77..793e9ecd56 100644 --- a/test/OpenMP/ordered_messages.cpp +++ b/test/OpenMP/ordered_messages.cpp @@ -4,7 +4,6 @@ int foo(); template T foo() { - T k; #pragma omp for ordered for (int i = 0; i < 10; ++i) { L1: @@ -96,44 +95,28 @@ T foo() { #pragma omp parallel for ordered for (int i = 0; i < 10; ++i) { #pragma omp ordered depend(source) // expected-error {{'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter}} - #pragma omp ordered depend(sink : i) // expected-error {{'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter}} } -#pragma omp parallel for ordered(2) // expected-note 5 {{'ordered' clause with specified parameter}} +#pragma omp parallel for ordered(1) // expected-note 3 {{'ordered' clause with specified parameter}} for (int i = 0; i < 10; ++i) { for (int j = 0; j < 10; ++j) { #pragma omp ordered depend // expected-error {{expected '(' after 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} -#pragma omp ordered depend( // expected-error {{expected ')'}} expected-error {{expected 'source' or 'sink' in OpenMP clause 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} expected-warning {{missing ':' or ')' after dependency type - ignoring}} expected-note {{to match this '('}} +#pragma omp ordered depend( // expected-error {{expected ')'}} expected-error {{expected 'source' in OpenMP clause 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} expected-warning {{missing ':' or ')' after dependency type - ignoring}} expected-note {{to match this '('}} #pragma omp ordered depend(source // expected-error {{expected ')'}} expected-note {{to match this '('}} -#pragma omp ordered depend(sink // expected-error {{expected expression}} expected-warning {{missing ':' or ')' after dependency type - ignoring}} expected-error {{expected ')'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} expected-note {{to match this '('}} -#pragma omp ordered depend(sink : // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} -#pragma omp ordered depend(sink : i // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'j' loop iteration variable}} -#pragma omp ordered depend(sink : i) // expected-error {{expected 'j' loop iteration variable}} #pragma omp ordered depend(source) if (i == j) #pragma omp ordered depend(source) // expected-error {{'#pragma omp ordered' with 'depend' clause cannot be an immediate substatement}} ; - if (i == j) -#pragma omp ordered depend(sink : i, j) // expected-error {{'#pragma omp ordered' with 'depend' clause cannot be an immediate substatement}} - ; #pragma omp ordered depend(source) threads // expected-error {{'depend' clauses cannot be mixed with 'threads' clause}} #pragma omp ordered simd depend(source) // expected-error {{'depend' clauses cannot be mixed with 'simd' clause}} #pragma omp ordered depend(source) depend(source) // expected-error {{directive '#pragma omp ordered' cannot contain more than one 'depend' clause with 'source' dependence}} -#pragma omp ordered depend(in : i) // expected-error {{expected 'source' or 'sink' in OpenMP clause 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} -#pragma omp ordered depend(sink : i, j) -#pragma omp ordered depend(sink : j, i) // expected-error {{expected 'i' loop iteration variable}} expected-error {{expected 'j' loop iteration variable}} -#pragma omp ordered depend(sink : i, j, k) // expected-error {{unexpected expression: number of expressions is larger than the number of associated loops}} -#pragma omp ordered depend(sink : i+foo(), j/4) // expected-error {{expression is not an integral constant expression}} expected-error {{expected '+' or '-' operation}} -#pragma omp ordered depend(sink : i*0, j-4)// expected-error {{expected '+' or '-' operation}} -#pragma omp ordered depend(sink : i-0, j+sizeof(T)) depend(sink : i-0, j+sizeof(T)) -#pragma omp ordered depend(sink : i-0, j+sizeof(T)) depend(source) // expected-error {{'depend(source)' clause cannot be mixed with 'depend(sink:vec)' clauses}} -#pragma omp ordered depend(source) depend(sink : i-0, j+sizeof(T)) // expected-error {{'depend(sink:vec)' clauses cannot be mixed with 'depend(source)' clause}} +#pragma omp ordered depend(in : i) // expected-error {{expected 'source' in OpenMP clause 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} } } + return T(); } int foo() { -int k; #pragma omp for ordered for (int i = 0; i < 10; ++i) { L1: @@ -225,39 +208,23 @@ int k; #pragma omp parallel for ordered for (int i = 0; i < 10; ++i) { #pragma omp ordered depend(source) // expected-error {{'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter}} - #pragma omp ordered depend(sink : i) // expected-error {{'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter}} } -#pragma omp parallel for ordered(2) // expected-note 5 {{'ordered' clause with specified parameter}} +#pragma omp parallel for ordered(1) // expected-note 3 {{'ordered' clause with specified parameter}} for (int i = 0; i < 10; ++i) { for (int j = 0; j < 10; ++j) { #pragma omp ordered depend // expected-error {{expected '(' after 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} -#pragma omp ordered depend( // expected-error {{expected ')'}} expected-error {{expected 'source' or 'sink' in OpenMP clause 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} expected-warning {{missing ':' or ')' after dependency type - ignoring}} expected-note {{to match this '('}} +#pragma omp ordered depend( // expected-error {{expected ')'}} expected-error {{expected 'source' in OpenMP clause 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} expected-warning {{missing ':' or ')' after dependency type - ignoring}} expected-note {{to match this '('}} #pragma omp ordered depend(source // expected-error {{expected ')'}} expected-note {{to match this '('}} -#pragma omp ordered depend(sink // expected-error {{expected expression}} expected-warning {{missing ':' or ')' after dependency type - ignoring}} expected-error {{expected ')'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} expected-note {{to match this '('}} -#pragma omp ordered depend(sink : // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} -#pragma omp ordered depend(sink : i // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'j' loop iteration variable}} -#pragma omp ordered depend(sink : i) // expected-error {{expected 'j' loop iteration variable}} #pragma omp ordered depend(source) if (i == j) #pragma omp ordered depend(source) // expected-error {{'#pragma omp ordered' with 'depend' clause cannot be an immediate substatement}} ; - if (i == j) -#pragma omp ordered depend(sink : i, j) // expected-error {{'#pragma omp ordered' with 'depend' clause cannot be an immediate substatement}} - ; #pragma omp ordered depend(source) threads // expected-error {{'depend' clauses cannot be mixed with 'threads' clause}} #pragma omp ordered simd depend(source) // expected-error {{'depend' clauses cannot be mixed with 'simd' clause}} #pragma omp ordered depend(source) depend(source) // expected-error {{directive '#pragma omp ordered' cannot contain more than one 'depend' clause with 'source' dependence}} -#pragma omp ordered depend(in : i) // expected-error {{expected 'source' or 'sink' in OpenMP clause 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} -#pragma omp ordered depend(sink : i, j) -#pragma omp ordered depend(sink : j, i) // expected-error {{expected 'i' loop iteration variable}} expected-error {{expected 'j' loop iteration variable}} -#pragma omp ordered depend(sink : i, j, k) // expected-error {{unexpected expression: number of expressions is larger than the number of associated loops}} -#pragma omp ordered depend(sink : i+foo(), j/4) // expected-error {{expression is not an integral constant expression}} expected-error {{expected '+' or '-' operation}} -#pragma omp ordered depend(sink : i*0, j-4)// expected-error {{expected '+' or '-' operation}} -#pragma omp ordered depend(sink : i-0, j+sizeof(int)) depend(sink : i-0, j+sizeof(int)) -#pragma omp ordered depend(sink : i-0, j+sizeof(int)) depend(source) // expected-error {{'depend(source)' clause cannot be mixed with 'depend(sink:vec)' clauses}} -#pragma omp ordered depend(source) depend(sink : i-0, j+sizeof(int)) // expected-error {{'depend(sink:vec)' clauses cannot be mixed with 'depend(source)' clause}} +#pragma omp ordered depend(in : i) // expected-error {{expected 'source' in OpenMP clause 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} } } - return foo(); // expected-note {{in instantiation of function template specialization 'foo' requested here}} + return foo(); } -- 2.40.0