-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[X86][MC] Linker error when using movdir64b #63045
Comments
@llvm/issue-subscribers-backend-x86 |
The problem seems to be in the generated assembly. Following is the out put of This makes me believe that issue is not in the linker, but with the ASM parser. This issue originates with patch D145893. And that's why reverting it fixes the issue. More specifically, the function isMem512_GR64() within the llvm/lib/Target/X86/AsmParser/X86Operand.h file. |
This patch is to fix the [[ #63045 | issue 63045]]. Look at the following code: ``` int main(int argc, char *argv[]) { int arr[1000]; __asm movdir64b rax, ZMMWORD PTR [arr] return 0; } ``` Compiling this code using `clang -O0 -fasm-blocks bug.c` gives the a linker error. The problem seems to be in the generated assembly. Following is the out put of `clang -S -O0 -fasm-blocks bug.c`: ``` movq %rsi, -16(%rbp) #APP movdir64b arr, %rax #NO_APP xorl %eax, %eax ``` The symbol `arr` should be replaced with some address like `-4(%rbp)`. This makes me believe that issue is not in the linker, but with the ASM parser. This issue originates with patch [D145893](https://reviews.llvm.org/D145893). And that's why reverting it fixes the issue. More specifically, the function [isMem512_GR64()](https://github.com/llvm/llvm-project/blob/ff471dcf7669b1ad7903a44d0773bef4eb175eb9/llvm/lib/Target/X86/AsmParser/X86Operand.h#L404) within the [llvm/lib/Target/X86/AsmParser/X86Operand.h](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/X86/AsmParser/X86Operand.h) file. Reviewed By: skan Differential Revision: https://reviews.llvm.org/D151863
Look at the following code:
Compiling this code using
clang -O0 -fasm-blocks bug.c
gives the a linker error.But, according to Intel SDM address to 512-bit data should be supported:
The text was updated successfully, but these errors were encountered: