[llvm] [X86] Reject 'p' constraint without 'a' modifier in inline asm (PR #185799)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 11 00:48:43 PDT 2026
================
@@ -7,7 +7,7 @@ define ptr @foo(ptr %Ptr) {
%Ptr.addr = alloca ptr, align 8
store ptr %Ptr, ptr %Ptr.addr, align 8
; CHECK: movq %rdi, -8(%rsp)
- %1 = tail call ptr asm "mov $1, $0\0A\09lea $2, $0", "=r,p,*m,~{dirflag},~{fpsr},~{flags}"(ptr %Ptr, ptr elementtype(ptr) %Ptr.addr)
+ %1 = tail call ptr asm "mov ${1:a}, $0\0A\09lea $2, $0", "=r,p,*m,~{dirflag},~{fpsr},~{flags}"(ptr %Ptr, ptr elementtype(ptr) %Ptr.addr)
----------------
MaskRay wrote:
@aemerson added this x86 test in https://reviews.llvm.org/D155023 but I think it's incorrect. In clang, `%1` dereferences the memory, unlike GCC.
https://github.com/llvm/llvm-project/pull/185799
More information about the llvm-commits
mailing list