From: David Majnemer Date: Fri, 15 May 2015 20:08:27 +0000 (+0000) Subject: [X86] Use a better sentinel offset for the FrameAddr index X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=7fa889dd8799a5db053d011031f8a1cdebed0e60;p=oota-llvm.git [X86] Use a better sentinel offset for the FrameAddr index Other pieces of CodeGen want to negate frame object offsets to account for architectures where the stack grows down. Our object is a pseudo object so it's offset doesn't matter. However, we shouldn't choose an offset which results in undefined behavior if you negate it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237474 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 2b5c60019e3..5ec719bbd8c 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -15637,7 +15637,7 @@ SDValue X86TargetLowering::LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const { // Set up a frame object for the return address. unsigned SlotSize = RegInfo->getSlotSize(); FrameAddrIndex = MF.getFrameInfo()->CreateFixedObject( - SlotSize, /*Offset=*/INT64_MIN, /*IsImmutable=*/false); + SlotSize, /*Offset=*/0, /*IsImmutable=*/false); FuncInfo->setFAIndex(FrameAddrIndex); } return DAG.getFrameIndex(FrameAddrIndex, VT);