@@ -662,7 +662,8 @@ class FirConverter : public Fortran::lower::AbstractConverter {
662662 assert (stmt.typedCall && " Call was not analyzed" );
663663 // Call statement lowering shares code with function call lowering.
664664 Fortran::semantics::SomeExpr expr{*stmt.typedCall };
665- auto res = createFIRExpr (toLocation (), &expr, stmtCtx);
665+ auto res = Fortran::lower::createSubroutineCall (
666+ *this , expr, localSymbols, stmtCtx, /* isUserDefAssignment=*/ false );
666667 if (!res)
667668 return ; // "Normal" subroutine call.
668669 // Call with alternate return specifiers.
@@ -1939,11 +1940,13 @@ class FirConverter : public Fortran::lower::AbstractConverter {
19391940 [&](const Fortran::evaluate::ProcedureRef &procRef) {
19401941 if (implicitIterationSpace ())
19411942 TODO (loc, " user defined assignment within WHERE" );
1943+
19421944 Fortran::semantics::SomeExpr expr{procRef};
1943- createFIRExpr (toLocation (), &expr,
1944- explicitIterationSpace ()
1945- ? explicitIterSpace.stmtContext ()
1946- : stmtCtx);
1945+ auto &ctx = explicitIterationSpace ()
1946+ ? explicitIterSpace.stmtContext ()
1947+ : stmtCtx;
1948+ Fortran::lower::createSubroutineCall (
1949+ *this , expr, localSymbols, ctx, /* isUserDefAssignment=*/ true );
19471950 },
19481951
19491952 // [3] Pointer assignment with possibly empty bounds-spec. R1035: a
0 commit comments