diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp index ae30d4dfc70f5..5a0d98da4146e 100644 --- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -4495,7 +4495,7 @@ bool X86AsmParser::matchAndEmitIntelInstruction( // compatible with gas. StringRef Mnemonic = (static_cast(*Operands[0])).getToken(); if (UnsizedMemOp) { - static const char *const PtrSizedInstrs[] = {"call", "jmp", "push"}; + static const char *const PtrSizedInstrs[] = {"call", "jmp", "push", "pop"}; for (const char *Instr : PtrSizedInstrs) { if (Mnemonic == Instr) { UnsizedMemOp->Mem.Size = getPointerWidth(); diff --git a/llvm/test/MC/X86/intel-syntax-ambiguous.s b/llvm/test/MC/X86/intel-syntax-ambiguous.s index e90cca820043b..ea38feefe2459 100644 --- a/llvm/test/MC/X86/intel-syntax-ambiguous.s +++ b/llvm/test/MC/X86/intel-syntax-ambiguous.s @@ -30,6 +30,7 @@ sub [eax], 1 // gas assumes these instructions are pointer-sized by default, and we follow // suit. push [eax] +pop [eax] call [eax] jmp [eax] // CHECK-NOT: error: diff --git a/llvm/test/MC/X86/intel-syntax-ptr-sized.s b/llvm/test/MC/X86/intel-syntax-ptr-sized.s index a360557eaa6a4..0393d8c84dfba 100644 --- a/llvm/test/MC/X86/intel-syntax-ptr-sized.s +++ b/llvm/test/MC/X86/intel-syntax-ptr-sized.s @@ -6,6 +6,8 @@ push [eax] // CHECK: pushl (%eax) call [eax] // CHECK: calll *(%eax) +pop [eax] +// CHECK: popl (%eax) jmp [eax] // CHECK: jmpl *(%eax) @@ -25,6 +27,8 @@ push [eax] // CHECK: pushw (%eax) call [eax] // CHECK: callw *(%eax) +pop [eax] +// CHECK: popw (%eax) jmp [eax] // CHECK: jmpw *(%eax)