[flang-commits] [flang] [flang][hlfir] address char_convert issues as mentioned in #64315 (PR #67570)

Anthony Cabrera via flang-commits flang-commits at lists.llvm.org
Tue Oct 3 09:17:21 PDT 2023


================
@@ -1435,8 +1434,10 @@ struct UnaryOp<
       // allocate space on the stack for toBuffer
       auto dest = builder.create<fir::AllocaOp>(loc, toTy,
                                                 mlir::ValueRange{bufferSize});
-      builder.create<fir::CharConvertOp>(loc, lhs.getFirBase(), origBufferSize,
-                                         dest);
+      auto src = hlfir::convertToAddress(loc, builder, lhs,
+                                         lhs.getFortranElementType());
+      builder.create<fir::CharConvertOp>(loc, src.first.getCharBox()->getAddr(),
+                                         origBufferSize, dest);
----------------
cabreraam wrote:

Added the call. What do you think?

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


More information about the flang-commits mailing list