We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa24875 commit 38d7efcCopy full SHA for 38d7efc
flang/lib/Lower/Bridge.cpp
@@ -4778,7 +4778,13 @@ class FirConverter : public Fortran::lower::AbstractConverter {
4778
nbDeviceResidentObject <= 1 &&
4779
"Only one reference to the device resident object is supported");
4780
auto addr = getSymbolAddress(sym);
4781
- hlfir::Entity entity{addr};
+ mlir::Value baseValue;
4782
+ if (auto declareOp = llvm::dyn_cast<hlfir::DeclareOp>(addr.getDefiningOp()))
4783
+ baseValue = declareOp.getBase();
4784
+ else
4785
+ baseValue = addr;
4786
+
4787
+ hlfir::Entity entity{baseValue};
4788
auto [temp, cleanup] =
4789
hlfir::createTempFromMold(loc, builder, entity);
4790
auto needCleanup = fir::getIntIfConstant(cleanup);
0 commit comments