@@ -1880,7 +1880,8 @@ void AccDataMap::remapDataOperandSymbols(
18801880 llvm::cast<hlfir::DeclareOp>(*computeDef).setSkipRebox (true );
18811881
18821882 symbolMap.addVariableDefinition (
1883- symbol, llvm::cast<fir::FortranVariableOpInterface>(computeDef));
1883+ symbol, llvm::cast<fir::FortranVariableOpInterface>(computeDef),
1884+ /* force=*/ true );
18841885 }
18851886
18861887 for (const auto &comp : components) {
@@ -2966,10 +2967,10 @@ genACCHostDataOp(Fortran::lower::AbstractConverter &converter,
29662967
29672968 fir::FirOpBuilder &builder = converter.getFirOpBuilder ();
29682969
2969- // When CUDA Fortran is enabled, extra symbols are created in the host_data
2970- // scope for use_device objects. Bind them to the outer scope's symbols before
2971- // processing any clauses, since the if clause may reference these symbols.
2972- if (semanticsContext. IsEnabled (Fortran::common::LanguageFeature::CUDA)) {
2970+ // Extra symbols are created in the host_data scope for use_device objects.
2971+ // Bind them to the outer scope's symbols before processing any clauses,
2972+ // since the if clause may reference these symbols.
2973+ {
29732974 for (const Fortran::parser::AccClause &clause : accClauseList.v ) {
29742975 if (const auto *useDevice =
29752976 std::get_if<Fortran::parser::AccClause::UseDevice>(&clause.u )) {
@@ -2981,13 +2982,7 @@ genACCHostDataOp(Fortran::lower::AbstractConverter &converter,
29812982 if (const auto *name =
29822983 Fortran::parser::GetDesignatorNameIfDataRef (*designator)) {
29832984 newSym = name->symbol ;
2984- } else if (const auto *arrayElement = Fortran::parser::Unwrap<
2985- Fortran::parser::ArrayElement>(*designator)) {
2986- const Fortran::parser::Name &name =
2987- Fortran::parser::GetLastName (arrayElement->Base ());
2988- newSym = name.symbol ;
2989- } else if (Fortran::parser::Unwrap<
2990- Fortran::parser::StructureComponent>(*designator)) {
2985+ } else {
29912986 newSym = Fortran::parser::GetFirstName (*designator).symbol ;
29922987 }
29932988 } else if (const auto *name =
0 commit comments