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

Simplification for (A ==/!= B) &/| (((cast)A) CMP C) #68514

Closed
k-arrows opened this issue Oct 8, 2023 · 2 comments
Closed

Simplification for (A ==/!= B) &/| (((cast)A) CMP C) #68514

k-arrows opened this issue Oct 8, 2023 · 2 comments

Comments

@k-arrows
Copy link

k-arrows commented Oct 8, 2023

Example:
https://godbolt.org/z/Pr8T7xsMz

bool f(int a)
{
    bool t = a == 0;
    short t1 = a;
    bool t2 = t1 >= 3;
    return t & t2;
}

bool g(int b)
{
    bool t = b == 3;
    short t1 = b;
    bool t2 = t1 >= 3;
    return t | t2;
}

The example above is taken from the following:
https://github.com/gcc-mirror/gcc/blob/master/gcc/testsuite/gcc.dg/tree-ssa/cmpbit-6.c
https://github.com/gcc-mirror/gcc/blob/master/gcc/testsuite/gcc.dg/tree-ssa/cmpbit-7.c

@dtcxzyw
Copy link
Member

dtcxzyw commented Oct 17, 2023

Alive2: https://alive2.llvm.org/ce/z/6EVKhN

@dtcxzyw
Copy link
Member

dtcxzyw commented Nov 12, 2023

Should be fixed by #70335.

@dtcxzyw dtcxzyw closed this as completed Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants