[llvm-branch-commits] [cfe-branch] r318107 - Merging r311777:
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Nov 13 15:26:36 PST 2017
Author: tstellar
Date: Mon Nov 13 15:26:36 2017
New Revision: 318107
URL: http://llvm.org/viewvc/llvm-project?rev=318107&view=rev
Log:
Merging r311777:
------------------------------------------------------------------------
r311777 | abataev | 2017-08-25 08:43:55 -0700 (Fri, 25 Aug 2017) | 5 lines
[OPENMP] Fix for PR34321: ustom OpenMP reduction in C++ template causes
SEGFAULT at compile time
Compiler crashed when tried to rebuild non-template expression in
dependent context.
------------------------------------------------------------------------
Modified:
cfe/branches/release_50/lib/Sema/SemaOpenMP.cpp
cfe/branches/release_50/test/OpenMP/declare_reduction_codegen.cpp
Modified: cfe/branches/release_50/lib/Sema/SemaOpenMP.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_50/lib/Sema/SemaOpenMP.cpp?rev=318107&r1=318106&r2=318107&view=diff
==============================================================================
--- cfe/branches/release_50/lib/Sema/SemaOpenMP.cpp (original)
+++ cfe/branches/release_50/lib/Sema/SemaOpenMP.cpp Mon Nov 13 15:26:36 2017
@@ -8858,7 +8858,8 @@ buildDeclareReductionRef(Sema &SemaRef,
PrevD = D;
}
}
- if (Ty->isDependentType() || Ty->isInstantiationDependentType() ||
+ if (SemaRef.CurContext->isDependentContext() || Ty->isDependentType() ||
+ Ty->isInstantiationDependentType() ||
Ty->containsUnexpandedParameterPack() ||
filterLookupForUDR<bool>(Lookups, [](ValueDecl *D) -> bool {
return !D->isInvalidDecl() &&
Modified: cfe/branches/release_50/test/OpenMP/declare_reduction_codegen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_50/test/OpenMP/declare_reduction_codegen.cpp?rev=318107&r1=318106&r2=318107&view=diff
==============================================================================
--- cfe/branches/release_50/test/OpenMP/declare_reduction_codegen.cpp (original)
+++ cfe/branches/release_50/test/OpenMP/declare_reduction_codegen.cpp Mon Nov 13 15:26:36 2017
@@ -92,6 +92,22 @@ T foo(T a) {
return a;
}
+struct Summary {
+ void merge(const Summary& other) {}
+};
+
+template <typename K>
+void work() {
+ Summary global_summary;
+#pragma omp declare reduction(+ : Summary : omp_out.merge(omp_in))
+#pragma omp parallel for reduction(+ : global_summary)
+ for (int k = 1; k <= 100; ++k) {
+ }
+}
+
+struct A {};
+
+
// CHECK-LABEL: @main
int main() {
int i = 0;
@@ -110,6 +126,8 @@ int main() {
// CHECK: call {{.*}}void (%ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(
// CHECK: call {{.*}}void (%ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(
// CHECK: call {{.*}}void (%ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call({{[^@]*}} @{{[^@]*}}[[REGION:@[^ ]+]]
+ // CHECK-LABEL: work
+ work<A>();
// CHECK-LABEL: foo
return foo(15);
}
More information about the llvm-branch-commits
mailing list