[flang-commits] [flang] [flang] Keep a LOGICAL input item unchanged on big-endian targets (PR #228588)

Eugene Epshteyn via flang-commits flang-commits at lists.llvm.org
Mon Oct 5 10:52:43 PDT 2026


================
@@ -1132,6 +1132,22 @@ static void boolRefToLogical(mlir::Location loc, fir::FirOpBuilder &builder,
   fir::StoreOp::create(builder, loc, logicalValue, addr);
 }
 
+/// Store the current value of a LOGICAL as a `bool` into the first byte of its
+/// storage before passing it to the runtime as a `bool&`. If the runtime does
+/// not set it (e.g. a null value in list-directed or namelist input), the
----------------
eugeneepshteyn wrote:

Namelist input never gets here: namelist items go to `InputNamelist` as descriptors, and the runtime stores the full LOGICAL kind there. An empty `L` field is an error, so the only case this covers is a list-directed null value. Suggest "(e.g. a list-directed null value)" here and in the test header (line 3).

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


More information about the flang-commits mailing list