================
@@ -1575,6 +1652,48 @@ void CodeGenFunction::EmitOMPReductionClauseInit(
auto *IPriv = Privates.begin();
for (const Expr *IRef : Shareds) {
const auto *PrivateVD =
cast<VarDecl>(cast<DeclRefExpr>(*IPriv)->getDecl());
+ const BindingDecl *BD = nullptr;
----------------
alexey-bataev wrote:
The BindingDecl path entirely skips ReductionCodeGen infrastructure
(emitSharedOrigLValue, emitAggregateType, emitInitialization, emitCleanups).
The manual EmitDecl(*PrivateVD) assumes the VarDecl was set up by Sema with the
correct reduction initializer for all cases. This breaks for: (a) array-type
reductions where emitAggregateType/emitInitialization perform element-wise
init; (b) user-defined reductions (UDR) that need the combiner/initializer from
the declare reduction clause; (c) cleanup registration for
non-trivially-destructible types. Either fix ReductionCodeGen to handle
BindingDecls (the proper fix), or document the limitations explicitly and add a
diagnostic rejecting unsupported reduction forms on bindings.
https://github.com/llvm/llvm-project/pull/190832
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits