@@ -276,7 +276,6 @@ void Fortran::lower::genPauseStatement(
276276 if (stmt.v .has_value ()) {
277277 const auto &code = stmt.v .value ();
278278 auto expr = converter.genExprValue (*Fortran::semantics::GetExpr (code), stmtCtx);
279- LLVM_DEBUG (llvm::dbgs () << " pause expression: " ; expr.dump (); llvm::dbgs () << ' \n ' );
280279 expr.match (
281280 // Character-valued expression -> call PauseStatementText (CHAR, LEN)
282281 [&](const fir::CharBoxValue &x) {
@@ -290,7 +289,7 @@ void Fortran::lower::genPauseStatement(
290289 },
291290 // Numeric/unboxed value -> call PauseStatement which accepts an integer code.
292291 [&](fir::UnboxedValue x) {
293- callee = fir::runtime::getRuntimeFunc<mkRTKey (PauseStatement )>(loc, builder);
292+ callee = fir::runtime::getRuntimeFunc<mkRTKey (PauseStatementInt )>(loc, builder);
294293 calleeType = callee.getFunctionType ();
295294 if (calleeType.getNumInputs () >= 1 ) {
296295 mlir::Value cast =
@@ -299,7 +298,8 @@ void Fortran::lower::genPauseStatement(
299298 }
300299 },
301300 [&](auto ) {
302- mlir::emitError (loc, " unhandled expression in PAUSE" );
301+ fir::emitFatalError (loc, " unhandled expression in PAUSE" );
302+ // mlir::emitError(loc, "unhandled expression in PAUSE");
303303 std::exit (1 );
304304 });
305305 } else {
@@ -309,10 +309,8 @@ void Fortran::lower::genPauseStatement(
309309
310310 fir::CallOp::create (builder, loc, callee, operands);
311311
312- // NOTE: PAUSE should not unconditionally terminate the current block.
313- // Unlike STOP, PAUSE does not necessarily abandon control flow, so do not
314- // subsequent control flow (e.g. GOTO/branches) to be generated.
315- // insert genUnreachable() here. Leaving the block un-terminated allows
312+ // NOTE: PAUSE does not terminate the current block. The program may resume
313+ // and continue normal execution, so we do not emit control-flow terminators.
316314}
317315
318316void Fortran::lower::genPointerAssociate (fir::FirOpBuilder &builder,
0 commit comments