https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123286
Bug ID: 123286
Summary: SAT_ADD is not constant folded at the gimple level
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Target: aarch64
I noticed that SAT_ADD was not folded at the gimple level:
Take the following aarch64 function:
```
#include <arm_neon.h>
unsigned long f(void)
{
return vqadd_u64((uint64x1_t){}, (uint64x1_t){})[0];
}
```
In .optimized we get:
```
long unsigned int f ()
{
long unsigned int _2;
<bb 2> [local count: 1073741824]:
_2 = .SAT_ADD (0, 0); [tail call]
return _2;
}
```