Skip to content

Commit e3d04a5

Browse files
committed
don't error on too-large stack frames, just trap at runtime
1 parent f2b79ab commit e3d04a5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

llvm/lib/Target/X86/X86FrameLowering.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -828,12 +828,9 @@ void X86FrameLowering::emitStackProbeInlineGenericLoop(
828828
.setMIFlag(MachineInstr::FrameSetup);
829829
} else {
830830
// We're being asked to probe a stack frame that's 4 GiB or larger,
831-
// but our stack pointer is only 32 bits.
832-
DiagnosticInfoResourceLimit Diag(MF.getFunction(),
833-
"probed stack frame size", BoundOffset,
834-
0xffffffff, DS_Error, DK_ResourceLimit);
835-
MF.getFunction().getContext().diagnose(Diag);
836-
return;
831+
// but our stack pointer is only 32 bits. This might be unreachable
832+
// code, so don't complain now; just trap if it's reached at runtime.
833+
BuildMI(MBB, MBBI, DL, TII.get(X86::TRAP));
837834
}
838835

839836
// while in the loop, use loop-invariant reg for CFI,

0 commit comments

Comments
 (0)