[llvm] r249522 - [X86] Emit .cfi_escape GNU_ARGS_SIZE when adjusting the stack before calls

Douglas Katzman via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 7 18:59:09 PDT 2015


>
> Do you happen to have a testcase handy?
>

The sanitizers on Linux comprise a test case it seems - they started
failing with this commit.
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/20647

Without my understanding this code in the least, if you just do what the
assertion says to do (as here), it fixes the sanitizers:

diff --git a/lib/Target/X86/X86FrameLowering.cpp
b/lib/Target/X86/X86FrameLowering.cpp
index 7f05e5b..d85b6a8 100644
--- a/lib/Target/X86/X86FrameLowering.cpp
+++ b/lib/Target/X86/X86FrameLowering.cpp
@@ -384,8 +384,9 @@ void X86FrameLowering::BuildCFI(MachineBasicBlock &MBB,
                                 MCCFIInstruction CFIInst) const {
   MachineFunction &MF = *MBB.getParent();
   unsigned CFIIndex = MF.getMMI().addFrameInst(CFIInst);
-  BuildMI(MBB, MBBI, DL, TII.get(TargetOpcode::CFI_INSTRUCTION))
-      .addCFIIndex(CFIIndex);
+  MachineInstrBuilder MIB = BuildMI(MBB, MBBI, DL,
TII.get(TargetOpcode::CFI_INSTRUCTION));
+  MIB.addCFIIndex(CFIIndex);
+  MIB->setFlag(MachineInstr::FrameSetup);
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151007/e1f197c7/attachment.html>


More information about the llvm-commits mailing list