From: Bill Wendling Date: Tue, 6 Dec 2011 19:09:06 +0000 (+0000) Subject: For a small sized stack, we encode that value directly with no "stack adjust" value. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=75e14e0ebd29bb2b1893948037c0ae5df4e09a41;p=oota-llvm.git For a small sized stack, we encode that value directly with no "stack adjust" value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145952 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86FrameLowering.cpp b/lib/Target/X86/X86FrameLowering.cpp index 7f3c13391d3..09aa114f1b6 100644 --- a/lib/Target/X86/X86FrameLowering.cpp +++ b/lib/Target/X86/X86FrameLowering.cpp @@ -565,7 +565,7 @@ uint32_t X86FrameLowering::getCompactUnwindEncoding(MachineFunction &MF) const { if ((FullOffset & 0xFF) == FullOffset) { // Frameless stack. CompactUnwindEncoding |= 0x02000000; - CompactUnwindEncoding |= (FullOffset & 0xFF) << 16; + CompactUnwindEncoding |= (CFAOffset & 0xFF) << 16; } else { if ((CFAOffset & 0x7) != CFAOffset) // The extra stack adjustments are too big for us to handle. @@ -582,6 +582,8 @@ uint32_t X86FrameLowering::getCompactUnwindEncoding(MachineFunction &MF) const { CompactUnwindEncoding |= (CFAOffset & 0x7) << 13; } + CompactUnwindEncoding |= ((6 - SavedRegIdx) & 0x7) << 10; + // Get the encoding of the saved registers when we don't have a frame // pointer. uint32_t RegEnc = encodeCompactUnwindRegistersWithoutFrame(SavedRegs,