aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.cc
diff options
context:
space:
mode:
authorAndrew Pinski <quic_apinski@quicinc.com>2024-11-17 20:21:58 -0800
committerAndrew Pinski <quic_apinski@quicinc.com>2024-11-18 00:50:26 -0800
commit45a3277149d95a51cf9109cab87ee39a7dce73e2 (patch)
tree3b3043fee2d78dc0f3705dc9c8906678458842fe /gcc/tree-if-conv.cc
parentdffc37deaddf08bd11208a459496b30021700203 (diff)
downloadgcc-45a3277149d95a51cf9109cab87ee39a7dce73e2.zip
gcc-45a3277149d95a51cf9109cab87ee39a7dce73e2.tar.gz
gcc-45a3277149d95a51cf9109cab87ee39a7dce73e2.tar.bz2
match: Fix the `max<a,b>==0` pattern for pointers [PR117646]
For pointers I forgot that BIT_IOR_EXPR is not valid so when I added the pattern to convert `max<a,b> != 0` (r15-5356), GCC would start to ICEing saying pointer types were not valid for BIT_IOR_EXPR. This fixes the problem by casting to the unsigned type of the inner type. There was another way of fixing this to handling it as `a == 0 & b == 0` but both match and reassoication (for pointers) will then convert it back into the form I am creating here so let's just use that form instead. Bootstrapped and tested on x86_64-linux-gnu. PR tree-optimization/117646 gcc/ChangeLog: * match.pd (`max<a,b>==0`): Add casts to `unsigned type`. gcc/testsuite/ChangeLog: * gcc.dg/torture/minmaxneeqptr-1.c: New test. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc/tree-if-conv.cc')
0 files changed, 0 insertions, 0 deletions