-
Notifications
You must be signed in to change notification settings - Fork 11.7k
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
fatal error: error in backend: Unsupported expression in static initializer: addrspacecast (ptr addrspace(256) @const_pcpu_hot to ptr) #93449
Comments
A trivial reproducer from the full __typeof__(int __seg_gs) const_pcpu_hot;
void *__attribute____UNIQUE_ID___addressable_const_pcpu_hot612 =
(void *)(long)&const_pcpu_hot;
|
@llvm/issue-subscribers-backend-x86 Author: Uroš Bizjak (ubizjak)
When compiling current -tip linux tree (27. May, 2024), with the patch series [1] that enables optimized percpu access via named address spaces also for clang applied, the compilation crashes when compiling arch/x86/kernel/cpu/common.c with:
The preprocessed file is attached, please compile with:
To get:
[1] https://lore.kernel.org/lkml/20240526175655.227798-1-ubizjak@gmail.com/ |
|
You can't fold an addrspacecast without target knowledge, so ConstantFoldConstant isn't going to do anything with it. The AsmPrinter would need to do something target specific with the constant expression cast, which is evidently not implemented by X86 |
This happens on recent kernel tree due to issues with LLVM. As we don't need any backends and only need to parse the source code we can disable the warning and move on. For more information about the issue take a look into ClangBuiltLinux/linux#2013 and llvm/llvm-project#93449. Signed-off-by: Marcos Paulo de Souza <[email protected]>
This happens on recent kernel tree due to issues with LLVM. As we don't need any backends and only need to parse the source code we can disable the warning and move on. For more information about the issue take a look into ClangBuiltLinux/linux#2013 and llvm/llvm-project#93449. Signed-off-by: Marcos Paulo de Souza <[email protected]>
When compiling current -tip linux tree (27. May, 2024), with the patch series [1] that enables optimized percpu access via named address spaces also for clang applied, the compilation crashes when compiling arch/x86/kernel/cpu/common.c with:
The preprocessed file is attached, please compile with:
clang -O2 -w -S common.i
To get:
common.i.gz
[1] https://lore.kernel.org/lkml/[email protected]/
The text was updated successfully, but these errors were encountered: