mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-04 06:09:05 +00:00
Add assertions that expose the PR7713 miscompilation: Accessing a stack slot
with a too-big register class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109488 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
dfc2c51d12
commit
516cd4575e
@ -1998,6 +1998,8 @@ void X86InstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
|||||||
const TargetRegisterClass *RC,
|
const TargetRegisterClass *RC,
|
||||||
const TargetRegisterInfo *TRI) const {
|
const TargetRegisterInfo *TRI) const {
|
||||||
const MachineFunction &MF = *MBB.getParent();
|
const MachineFunction &MF = *MBB.getParent();
|
||||||
|
assert(MF.getFrameInfo()->getObjectSize(FrameIdx) >= RC->getSize() &&
|
||||||
|
"Stack slot too small for store");
|
||||||
bool isAligned = (RI.getStackAlignment() >= 16) || RI.canRealignStack(MF);
|
bool isAligned = (RI.getStackAlignment() >= 16) || RI.canRealignStack(MF);
|
||||||
unsigned Opc = getStoreRegOpcode(SrcReg, RC, isAligned, TM);
|
unsigned Opc = getStoreRegOpcode(SrcReg, RC, isAligned, TM);
|
||||||
DebugLoc DL = MBB.findDebugLoc(MI);
|
DebugLoc DL = MBB.findDebugLoc(MI);
|
||||||
@ -2030,6 +2032,8 @@ void X86InstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
|||||||
const TargetRegisterClass *RC,
|
const TargetRegisterClass *RC,
|
||||||
const TargetRegisterInfo *TRI) const {
|
const TargetRegisterInfo *TRI) const {
|
||||||
const MachineFunction &MF = *MBB.getParent();
|
const MachineFunction &MF = *MBB.getParent();
|
||||||
|
assert(MF.getFrameInfo()->getObjectSize(FrameIdx) >= RC->getSize() &&
|
||||||
|
"Stack slot too small for load");
|
||||||
bool isAligned = (RI.getStackAlignment() >= 16) || RI.canRealignStack(MF);
|
bool isAligned = (RI.getStackAlignment() >= 16) || RI.canRealignStack(MF);
|
||||||
unsigned Opc = getLoadRegOpcode(DestReg, RC, isAligned, TM);
|
unsigned Opc = getLoadRegOpcode(DestReg, RC, isAligned, TM);
|
||||||
DebugLoc DL = MBB.findDebugLoc(MI);
|
DebugLoc DL = MBB.findDebugLoc(MI);
|
||||||
|
Loading…
Reference in New Issue
Block a user