Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missed opportunities for reducing test cases #273

Open
berolinux opened this issue Feb 10, 2024 · 0 comments
Open

Missed opportunities for reducing test cases #273

berolinux opened this issue Feb 10, 2024 · 0 comments

Comments

@berolinux
Copy link
Contributor

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

  1. remove an unnecessary struct when the a member moved outside of the struct is sufficient
  2. change an enum to a static number (twice)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant