Index: lib/Target/X86/AsmParser/X86AsmParser.cpp =================================================================== --- lib/Target/X86/AsmParser/X86AsmParser.cpp +++ lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -912,6 +912,11 @@ if (RegNo == 0) RegNo = MatchRegisterName(Tok.getString().lower()); + if (isParsingInlineAsm() && isParsingIntelSyntax() && RegNo == X86::EFLAGS) { + // Cannot address reg called "flags" in MS inline asm - this is just an identifier! + RegNo = 0; + } + if (!is64BitMode()) { // FIXME: This should be done using Requires and // Requires so "eiz" usage in 64-bit instructions can be also