Trying to find a test case for llvm/llvm-project#72026 with creduce resulted in
enum { a, b, c };
struct {
long d[c]
} e;
enum { f = 3 };
char g();
void h() { asm("" : "+m"(e.d[b + (g() & f)])); }
This is already a lot more manageable than the original code, but could be reduced quite a bit further manually:
long a[0];
char b();
void c() { asm("" : "+m"(a[1 + (b() & 1)])); }
Looks like creduce misses opportunities to
- remove an unnecessary struct when the a member moved outside of the struct is sufficient
- change an enum to a static number (twice)