[flang-commits] [flang] [flang][nfc] Support volatility in Fir ops (PR #134858)

via flang-commits flang-commits at lists.llvm.org
Tue Apr 22 08:12:18 PDT 2025


================
@@ -1787,6 +1843,10 @@ llvm::LogicalResult fir::EmboxOp::verify() {
     return emitOpError("slice must not be provided for a scalar");
   if (getSourceBox() && !mlir::isa<fir::ClassType>(getResult().getType()))
     return emitOpError("source_box must be used with fir.class result type");
+  if (fir::isa_volatile_type(getMemref().getType()) !=
+      fir::isa_volatile_type(getResult().getType()))
+    return emitOpError("cannot convert between volatile and non-volatile "
+                       "types, use fir.volatile_cast instead");
----------------
jeanPerier wrote:

I believe fir.convert is used for PTR to INT conversions. Isn't this causing verifier issues when using LOC on a VOLATILE variable?

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


More information about the flang-commits mailing list