-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
[AArch64] Crash when compiling global register variable __asm__("x15") without -ffixed-x15 #76426
Comments
@llvm/issue-subscribers-backend-aarch64 Author: Masahiro ARAKAWA (arakawamasahiro-fj)
clang in AArch64 environment, fatal error at compile time.
If a global register variable associated with the register x15 is defined in the program and referenced in the program, a fatal error occurs at compile time when -ffixed-x15 is not specified.
When -ffixed-x15 is specified, it can be compiled.
Though failing to compile without -ffixed-x15 may be intentional, it should not be a fatal error.
Here is the program and compilation log:
[program] register int i1 __asm__("x15");
int foo(int i) {
return i1;
}
int main() {
return 0;
} [compile log]
[test_x15-659ab1.c]
[test_x15-659ab1.sh]
|
I took a look a bit. Stack trace: https://godbolt.org/z/dY7h77KKr Rejecting a Clang has checks to validate the register name. Especially, there is a check to validate the register name used for global register variables. X86 overrides the |
…s used (#117419) Relanding the patch with a fix for a test failure on build bots that do not build LLVM for AArch64. Fixes #76426, #109778 (for AArch64) The previous patch for this issue, #94271, generated an error message if a register and a global variable did not have the same size. This patch checks if the register is reserved.
…lvm#117419) Fixes llvm#76426, llvm#109778 (for AArch64) The previous patch for this issue, llvm#94271, generated an error message if a register and a global variable did not have the same size. This patch checks if the register is reserved.
…s used (llvm#117419) Relanding the patch with a fix for a test failure on build bots that do not build LLVM for AArch64. Fixes llvm#76426, llvm#109778 (for AArch64) The previous patch for this issue, llvm#94271, generated an error message if a register and a global variable did not have the same size. This patch checks if the register is reserved.
clang in AArch64 environment, fatal error at compile time.
If a global register variable associated with the register x15 is defined in the program and referenced in the program, a fatal error occurs at compile time when -ffixed-x15 is not specified.
When -ffixed-x15 is specified, it can be compiled.
Though failing to compile without -ffixed-x15 may be intentional, it should not be a fatal error.
Here is the program and compilation log:
[program]
[compile log]
[test_x15-659ab1.c]
[test_x15-659ab1.sh]
The text was updated successfully, but these errors were encountered: