Don't simplify (A & C) != 0 ? D : 0 for pointer types.
authorAndrew Pinski <apinski@marvell.com>
Sun, 16 May 2021 17:40:16 +0000 (10:40 -0700)
committerAndrew Pinski <apinski@marvell.com>
Sun, 23 May 2021 08:08:14 +0000 (08:08 +0000)
commit99b76adb94d9363d0ca31a7d34ce850e2ca9ffc5
treecbfa31dec87d011b45c6a5204bc44b3dc707ae73
parent15d30d2f20794d29ceabcfd57d230d6387284115
Don't simplify (A & C) != 0 ? D : 0 for pointer types.

While rewriting part of PHI-OPT to use match-and-simplify,
I ran into a bug where this pattern in match.pd would hit
and would produce invalid gimple; a shift of a pointer type.

This just disables this simplification for pointer types similarly
to what is already done in PHI-OPT for the generic A ? D : 0 case.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

Thanks,
Andrew Pinski

2021-5-23  Andrew Pinski  <apinski@marvell.com>

gcc/
* match.pd ((A & C) != 0 ? D : 0): Limit to non pointer types.

gcc/testsuite/
* gcc.dg/gimplefe-45.c: New test.
gcc/match.pd
gcc/testsuite/gcc.dg/gimplefe-45.c [new file with mode: 0644]