https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126531
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Andrew Macleod <[email protected]>: https://gcc.gnu.org/g:728104624f30f8eb9f537a3f91b7bb35e4e3a98c commit r17-4711-g728104624f30f8eb9f537a3f91b7bb35e4e3a98c Author: Andrew MacLeod <[email protected]> Date: Fri Sep 25 10:19:38 2026 -0400 Correct inferred range application. If there is an abnormal outgoing edge in a block, we are not supposed to apply any inferred ranges from the final statement as being exported from the block. The existing code had the logic incorrect. It was adding ranges if there was at least 1 normal edge rather than not adding them if there was at least one abnormal edge. The existing testcase was also flawed in that it was missing the flag to test with optimization, which caused it to pass when it should not have. Assisted-by: Claude Opus 5 PR tree-optimization/126531 gcc/ * gimple-range-cache.cc (ranger_cache::apply_inferred_ranges): Do not update if there are abnormal edges. gcc/testsuite/ * g++.dg/pr126531.C: Add optimization flag.
