Skip to content

Missed opportunities for reducing test cases #273

@berolinux

Description

@berolinux

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions