Skip to content

[flang][hlfir] Potential excessive stack usage #62419

Open
@vzakhari

Description

@vzakhari

During converting AssignOp to FIR we insert AllocaOp here:

mlir::Value temp = builder.create<fir::AllocaOp>(loc, lhsValueType);

If the AssignOp is inside a loop, this alloca may cause excessive stack usage. We need to either insert stacksave/stackrestore around it or use fir::FirOpBuilder::createTemporary as discussed in https://reviews.llvm.org/D149222.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorcrashPrefer [crash-on-valid] or [crash-on-invalid]flang:ir

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions