| Issue |
238192
|
| Summary |
[AArch64][PAC] --target=aarch64-linux-pauthtest crashes with "Cannot select: AArch64ISD::AUTH_CALL" unless +pauth is given explicitly
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
zjy-dev
|
The `pauthtest` triple turns on `-fptrauth-calls` and the related flags by default, but the target CPU stays
`generic` (`+v8a`, so no `+pauth`). For any non-tail indirect call, SelectionDAG then creates `AUTH_CALL`. The
only pattern for that node is the `BLRA` pseudo, which is under `let Predicates = [HasPAuth]`. ISel aborts.
The -O0 path (`blraaz x8`) and the tail-call path (`braaz x0`) emit PAuth instructions without the feature
and do not crash, so the three call-lowering paths disagree.
```c
int call(int (*f)(void)) { return f() + 1; } /* non-tail indirect call */
```
Compile flag: `clang --target=aarch64-linux-pauthtest -O1 -c trigger.c`
```
== clang --target=aarch64-linux-pauthtest -O1 -c trigger.c
fatal error: error in backend: Cannot select: 0x..: ch,glue = AArch64ISD::AUTH_CALL 0x.., 0x.., TargetConstant:i32<0>, TargetConstant:i64<0>, Register:i64 $noreg, ...
In function: call
rc=1
== clang --target=aarch64-linux-pauthtest -O0 -c trigger.c
rc=0 # emits blraaz x8 without +pauth
== clang --target=aarch64-linux-pauthtest -O1 -march=armv8.3-a -c trigger.c
rc=0
```
Every lit test for this configuration passes `-mattr=+pauth` explicitly (for example `ptrauth-tail-call-global.ll`), so the
default driver configuration is never covered. This also reproduces with clang trunk on Compiler Explorer (same
"Cannot select", exit code 70).
**Suggested fix:** have the driver imply `+pauth` (or a v8.3-a baseline) for the pauthtest ABI / `-fptrauth-calls`,
or emit a clear diagnostic when ptrauth calls are requested without PAuth. Avoid a backend fatal error. Also make the
-O0, tail-call and non-tail paths agree on whether PAuth is required.
Environment: clang 23.1.2 (llvmorg-23.1.2), target aarch64-unknown-linux-pauthtest.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs