On Thu, Nov 6, 2025 at 8:53 AM Karl Meakin via Sourceware Forge
<[email protected]> wrote:
>
>
> From: Karl Meakin <[email protected]>
>
> Apply the same fix from bc11cbff9e648fdda2798bfa2d7151d5cd164b87
> ("aarch64: Fix condition accepted by mov<ALLI>cc") to `MOV<GPF>cc`.
> Fixes ICEs when compiling code such as `cmpbr-4.c` with `+cmpbr`.
>
> gcc/ChangeLog:
>
> * config/aarch64/aarch64.md(mov<GPF>cc): Accept MODE_CC
> conditions directly; reject QI/HImode conditions.
>
> gcc/testsuite/ChangeLog:
>
> * gcc.target/aarch64/cmpbr-4.c: New test.
Another test you can add is a gimple one so you don't need to depend
on other optimizations:
```
/* { dg-do compile } */
/* { dg-options "-fgimple -O1" } */
#pragma GCC target "+cmpbr"
typedef unsigned short us;
__GIMPLE double f(us x, us y, double a, double b)
{
bool c;
double d;
c = x == y;
d = c ? a : b;
return d;
}
```
Otherwise LGTM.
Thanks,
Andrew
> ---
> gcc/config/aarch64/aarch64.md | 48 +++++++++++++++-------
> gcc/testsuite/gcc.target/aarch64/cmpbr-4.c | 12 ++++++
> 2 files changed, 45 insertions(+), 15 deletions(-)
> create mode 100644 gcc/testsuite/gcc.target/aarch64/cmpbr-4.c
>