https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110908

            Bug ID: 110908
           Summary: [aarch64] Internal compiler error when using
                    -ffixed-x30
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zach-gcc at cs dot stanford.edu
  Target Milestone: ---

Example:

```
void bar();

int foo() {
    bar();
    return 0;
}
```

Compile:

```
$ aarch64-none-elf-gcc -ffixed-x30 -c test.c
during RTL pass: ira
test.c: In function 'foo':
test.c:6:1: internal compiler error: in aarch64_layout_frame, at
config/aarch64/aarch64.cc:8483
    6 | }
      | ^
0x7f56c8d17d8f __libc_start_call_main
        ../sysdeps/nptl/libc_start_call_main.h:58
0x7f56c8d17e3f __libc_start_main_impl
        ../csu/libc-start.c:392
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
```

I realize it's not clear exactly what GCC should do if the return address
register is fixed. Here's what LLVM/Clang does, and what I would like GCC to
do: it continues to use x30 as the return address, but never uses it as a
general-purpose register for any computations (I'm not sure if GCC will ever do
this to begin with, or if this behavior can be disabled via another mechanism).
At the very least, it probably shouldn't cause an internal compiler error.

Thanks!

Reply via email to