From ee08897fb8d4b59b4609f6e837205e7a089b6fb7 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 10 Dec 2013 18:27:32 +0000 Subject: Reland "Fix miscompile of MS inline assembly with stack realignment" This re-lands commit r196876, which was reverted in r196879. The tests have been fixed to pass on platforms with a stack alignment larger than 4. Update to clang side tests will land shortly. llvm-svn: 196939 --- llvm/lib/MC/MCParser/AsmParser.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/MC/MCParser/AsmParser.cpp') diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index fe3969a0a78..a336cb97c66 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -4208,6 +4208,11 @@ bool AsmParser::parseMSInlineAsm( AsmStrRewrites.push_back(AsmRewrite(AOK_Input, Start, SymName.size())); } } + + // Consider implicit defs to be clobbers. Think of cpuid and push. + const uint16_t *ImpDefs = Desc.getImplicitDefs(); + for (unsigned I = 0, E = Desc.getNumImplicitDefs(); I != E; ++I) + ClobberRegs.push_back(ImpDefs[I]); } // Set the number of Outputs and Inputs. -- cgit v1.2.3