[flang-commits] [flang] [flang] Lower non optional inquired argument in custom intrinsic lowering (PR #93592)

via flang-commits flang-commits at lists.llvm.org
Wed May 29 02:37:18 PDT 2024


================
@@ -2436,8 +2436,9 @@ genCustomIntrinsicRef(const Fortran::evaluate::SpecificIntrinsic *intrinsic,
                                          getActualFortranElementType());
       break;
     case fir::LowerIntrinsicArgAs::Inquired:
-      TODO(loc, "Inquired non-optional arg to intrinsic with custom handling");
-      return;
+      exv = Fortran::lower::convertToBox(loc, converter, actual, stmtCtx,
----------------
jeanPerier wrote:

I do not think this is the right function to call, convertToBox will generate the dereference of the pointer (the fir.load), while inquired arguments should not be touched until inquired (they may be absent, deallocated....).

I would expect `Fortran::lower::translateToExtendedValue(loc, builder, actual, stmtCtx);` here.

https://github.com/llvm/llvm-project/pull/93592


More information about the flang-commits mailing list