https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126994
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <[email protected]>: https://gcc.gnu.org/g:ba472b886b31046afba1df687b65bd862b087240 commit r17-3785-gba472b886b31046afba1df687b65bd862b087240 Author: Lunex <[email protected]> Date: Sat Aug 29 23:46:07 2026 +0600 tree-optimization: Fix missing may_be_zero check in final value replacement The call to analyze_and_compute_bitop_with_inv_effect in final_value_replacement_loop did not guard on niter_desc.may_be_zero, so the XOR parity mask was computed from an invalid niter value when the loop could exit on the first iteration. PR tree-optimization/126994 * tree-scalar-evolution.cc (final_value_replacement_loop): Guard analyze_and_compute_bitop_with_inv_effect on integer_zerop (niter_desc.may_be_zero). * gcc.c-torture/execute/pr126994.c: New test. Signed-off-by: Lunex <[email protected]>
