https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126934
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrea Pinski <[email protected]>: https://gcc.gnu.org/g:ea41a5efe4b4a715f66ebfcad35cfd3b22e94690 commit r17-3434-gea41a5efe4b4a715f66ebfcad35cfd3b22e94690 Author: Andrea Pinski <[email protected]> Date: Tue Aug 18 21:33:46 2026 -0700 ranger: Fix operator_div with VREL_LT [PR126934] The problem here (which I missed during the review) is that when we don't set the rel_range to 0, the rel_range will be undefined (rather than varying) so when we do an intersection with that the lhs becomes undefined. That is wrong. This fixes the problem by instead doing an early return if either of the ops are not nonnegative. Pushed as obvious after bootstrap/test on x86_64-linux-gnu. PR tree-optimization/126934 gcc/ChangeLog: * range-op.cc (operator_div::op1_op2_relation_effect): Fix for ops range being negative with VREL_LT. gcc/testsuite/ChangeLog: * gcc.dg/torture/pr126934-1.c: New test. Signed-off-by: Andrea Pinski <[email protected]>
