https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126745
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Daniel Barboza <[email protected]>: https://gcc.gnu.org/g:7c25b09da5841ce372415a97c557509a8a0bb468 commit r17-3610-g7c25b09da5841ce372415a97c557509a8a0bb468 Author: Daniel Barboza <[email protected]> Date: Mon Aug 17 11:17:39 2026 -0300 range-op.cc: add VREL_EQ relation effect for div and mod [PR126745] For res = a / b and a == b, set 'res' to one. For res = a % b and a == b, set 'res' to zero. Both are done by dom2/dom3 already. With this change we're now doing it earlier (with -O2) in evrp. Bootstrapped and regtested in x86_64. PR tree-optimization/126745 gcc/ChangeLog: * range-op.cc (operator_div::op1_op2_relation_effect): add VREL_EQ range equal one for op1/op2 and op1%op2 if op1 == op2. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr126745.c: New test.
