diff --git a/flang/lib/Lower/OpenMP.cpp b/flang/lib/Lower/OpenMP.cpp --- a/flang/lib/Lower/OpenMP.cpp +++ b/flang/lib/Lower/OpenMP.cpp @@ -1127,12 +1127,13 @@ mlir::Value address = fir::getBase(converter.genExprAddr( *Fortran::semantics::GetExpr(assignmentStmtVariable), stmtCtx)); - const Fortran::semantics::Symbol *updateSymbol; + const Fortran::semantics::Symbol *updateSymbol = nullptr; if (auto varDesignator = std::get_if< Fortran::common::Indirection>( &assignmentStmtVariable.u)) { if (const auto *name = getDesignatorNameIfDataRef(varDesignator->value())) { updateSymbol = name->symbol; + assert(updateSymbol && "No symbol attached to atomic update variable"); } } // If no hint clause is specified, the effect is as if