http://llvm.org/bugs/show_bug.cgi?id=17545

            Bug ID: 17545
           Summary: X86FrameLowering::getFrameIndexOffset generates wrong
                    offsets
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Created attachment 11360
  --> http://llvm.org/bugs/attachment.cgi?id=11360&action=edit
Source Of The Crash And Patch

int X86FrameLowering::getFrameIndexOffset(const MachineFunction &MF, int FI)
const {
  const X86RegisterInfo *RegInfo =
    static_cast<const X86RegisterInfo*>(MF.getTarget().getRegisterInfo());
  const MachineFrameInfo *MFI = MF.getFrameInfo();
-  int Offset = MFI->getObjectOffset(FI) - getOffsetOfLocalArea();
+  int Offset = MFI->getObjectOffset(FI);
The Offset have already been considered OffsetOfLocalArea once,in
PEI::calculateFrameObjectOffsets.So subtract it back here make the offset
smaller than expected.

The file uploaded is the ll source cause a crash and a patch fixing this bug.
Crash cause:
The SkMatrix object is in [SP-60],but [SP-64] is what we expecting.This stack
object is align to 16 bytes.

  %mat = alloca %class.SkMatrix, align 16

So the vmovaps inst will cause a gp exception when accessing unaligned stack
address.

the compile command is 
llc -O2 -o crashx86.s crashx86.ll

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to