Skip to content

ARM64: issue with frame pointer offsets out of range #11812

@BruceForstall

Description

@BruceForstall

There are a couple cases where the expression generated by arm64 codegen might not be encodable.

In CodeGen::genReportGenericContextArg(regNumber initReg, bool* pInitRegZeroed)
...
    getEmitter()->emitIns_R_R_I(ins_Store(TYP_I_IMPL), EA_PTRSIZE, reg, genFramePointerReg(),
                                compiler->lvaCachedGenericContextArgOffset());

With a huge frame (>32760 bytes), generating [fp + lvaCachedGenericContextArgOffset()] won't be encodable, if it is placed on the frame far from fp.

In genFnProlog():

    if (compiler->info.compPublishStubParam)
    {
#if CPU_LOAD_STORE_ARCH
        getEmitter()->emitIns_R_R_I(ins_Store(TYP_I_IMPL), EA_PTRSIZE, REG_SECRET_STUB_PARAM, genFramePointerReg(),
                                    compiler->lvaTable[compiler->lvaStubArgumentVar].lvStkOffs);

If the sub argument is far from fp, the expression won't be encodable.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions