Index: lib/Target/X86/AsmParser/X86AsmParser.cpp =================================================================== --- lib/Target/X86/AsmParser/X86AsmParser.cpp +++ lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -1394,7 +1394,7 @@ return ErrorOperand(BracLoc, "Expected '[' token!"); Parser.Lex(); // Eat '[' - SMLoc StartInBrac = Tok.getLoc(); + SMLoc StartInBrac = Parser.getTok().getLoc(); // Parse [ Symbol + ImmDisp ] and [ BaseReg + Scale*IndexReg + ImmDisp ]. We // may have already parsed an immediate displacement before the bracketed // expression. @@ -1423,7 +1423,8 @@ // Parse struct field access. Intel requires a dot, but MSVC doesn't. MSVC // will in fact do global lookup the field name inside all global typedefs, // but we don't emulate that. - if (Tok.getString().find('.') != StringRef::npos) { + if (Parser.getTok().getKind() == AsmToken::Identifier && + Parser.getTok().getString().find('.') != StringRef::npos) { const MCExpr *NewDisp; if (ParseIntelDotOperator(Disp, NewDisp)) return nullptr; Index: test/MC/X86/pr28547.s =================================================================== --- /dev/null +++ test/MC/X86/pr28547.s @@ -0,0 +1,5 @@ +// RUN: llvm-mc -triple x86_64-unknown-unknown %s + .intel_syntax +ones: + .float +1.0, +1.0, +1.0, +1.0 + vmovaps xmm15, xmmword ptr [rip+ones] # +1.0, +1.0, +1.0, +1.0