From: Michael Kuperstein Date: Thu, 30 Jul 2015 10:10:25 +0000 (+0000) Subject: [X86] Recognize "flags" as an identifier, not a register in Intel-syntax inline asm X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=78a589c319e4f9d5f43b5afbe07ab48bb38d0745;p=oota-llvm.git [X86] Recognize "flags" as an identifier, not a register in Intel-syntax inline asm Patch by: marina.yatsina@intel.com Differential Revision: http://reviews.llvm.org/D11512 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243630 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp index 6b3c4d85614..637629118ac 100644 --- a/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -912,6 +912,11 @@ bool X86AsmParser::ParseRegister(unsigned &RegNo, if (RegNo == 0) RegNo = MatchRegisterName(Tok.getString().lower()); + // The "flags" register cannot be referenced directly. + // Treat it as an identifier instead. + if (isParsingInlineAsm() && isParsingIntelSyntax() && RegNo == X86::EFLAGS) + RegNo = 0; + if (!is64BitMode()) { // FIXME: This should be done using Requires and // Requires so "eiz" usage in 64-bit instructions can be also