https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125453
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <[email protected]>: https://gcc.gnu.org/g:44c5f9a37aa3dffac654c743147021df917daab0 commit r17-761-g44c5f9a37aa3dffac654c743147021df917daab0 Author: Andrew Pinski <[email protected]> Date: Mon May 25 12:44:48 2026 -0700 match: Fix up `(smaller)a ==/!= (smaller) b` pattern for pointers [PR125453] While reviewing r17-632-g1c9808a71207eb, I missed that it was valid (in gimple) to cast from a pointer to a smaller integral type. That meant with that pattern we would get `ptr ^ ptr` which is invalid gimple. This adds a check for integral type before applying this pattern. Pushed as obvious after a bootstrap/test on x86_64-linux-gnu. PR tree-optimization/125453 gcc/ChangeLog: * match.pd (`(smaller)a ==/!= (smaller) b`): Reject non integral types. gcc/testsuite/ChangeLog: * gcc.dg/torture/pr125453-1.c: New test. Signed-off-by: Andrew Pinski <[email protected]>
