[Bug tree-optimization/125749] `MAX<a,b> == 0` -> (A|B) == 0 should happen for signed types if a and b are nonnegative
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Jun 28 00:44:00 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125749
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>:
https://gcc.gnu.org/g:61b702d88c8e55affc2bdbd4fee0187a0d72e397
commit r17-1938-g61b702d88c8e55affc2bdbd4fee0187a0d72e397
Author: Kael Andrew Alonzo Franco <kaelfandrew@gmail.com>
Date: Sat Jun 27 17:56:29 2026 -0400
match: Use tree_expr_nonnegative_p instead of
TYPE_UNSIGNED for MAX (A, B) (==,!=) 0 -> (A|B) (==,!=) 0 [PR125749]
tree_expr_nonnegative_p covers non negative signed type variables,
unlike TYPE_UNSIGNED.
Bootstrapped and tested on x86_64-pc-linux-gnu
PR tree-optimization/125749
gcc/ChangeLog:
PR tree-optimization/125749
* match.pd: Use tree_expr_nonnegative_p for MAX (A, B) (==,!=) 0 ->
(A|B) (==,!=) 0.
gcc/testsuite/ChangeLog:
PR tree-optimization/125749
* gcc.dg/pr125749.c: New test.
Signed-off-by: Kael Franco <kaelfandrew@gmail.com>
More information about the Gcc-bugs
mailing list