[llvm-branch-commits] [llvm-branch] r109515 - /llvm/branches/Apple/williamson/lib/Target/X86/X86InstrInfo.cpp

Daniel Dunbar daniel at zuster.org
Tue Jul 27 10:49:46 PDT 2010


Author: ddunbar
Date: Tue Jul 27 12:49:46 2010
New Revision: 109515

URL: http://llvm.org/viewvc/llvm-project?rev=109515&view=rev
Log:
Merge r109488:
--
Author: Jakob Stoklund Olesen <stoklund at 2pi.dk>
Date:   Tue Jul 27 04:16:58 2010 +0000

    Add assertions that expose the PR7713 miscompilation: Accessing a stack slot
    with a too-big register class.

Modified:
    llvm/branches/Apple/williamson/lib/Target/X86/X86InstrInfo.cpp

Modified: llvm/branches/Apple/williamson/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/williamson/lib/Target/X86/X86InstrInfo.cpp?rev=109515&r1=109514&r2=109515&view=diff
==============================================================================
--- llvm/branches/Apple/williamson/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/branches/Apple/williamson/lib/Target/X86/X86InstrInfo.cpp Tue Jul 27 12:49:46 2010
@@ -1998,6 +1998,8 @@
                                        const TargetRegisterClass *RC,
                                        const TargetRegisterInfo *TRI) const {
   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);
   unsigned Opc = getStoreRegOpcode(SrcReg, RC, isAligned, TM);
   DebugLoc DL = MBB.findDebugLoc(MI);
@@ -2030,6 +2032,8 @@
                                         const TargetRegisterClass *RC,
                                         const TargetRegisterInfo *TRI) const {
   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);
   unsigned Opc = getLoadRegOpcode(DestReg, RC, isAligned, TM);
   DebugLoc DL = MBB.findDebugLoc(MI);





More information about the llvm-branch-commits mailing list