[Bug tree-optimization/122104] [13 Regression] Incorrect range after widening_mul creating MUL_OVERFLOW since r11-6579
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Mar 22 05:14:30 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122104
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:5f20abacfe6e29d66abedbd8370faf2d8da92e8d
commit r13-10169-g5f20abacfe6e29d66abedbd8370faf2d8da92e8d
Author: Jakub Jelinek <jakub@redhat.com>
Date: Sat Oct 4 17:06:16 2025 +0200
widening_mul: Reset flow sensitive info in maybe_optimize_guarding_check
[PR122104]
In PR95852 I've added an optimization where next to just pattern
recognizing r = x * y; r / x != y or r = x * y; r / x == y
as .MUL_OVERFLOW or negation thereof it also recognizes
r = x * y; x && (r / x != y) or r = x * y; !x || (r / x == y)
by optimizing the guarding condition to always true/false.
The problem with that is that some value ranges recorded for
the SSA_NAMEs in the formerly conditional, now unconditional
basic block can be invalid.
This patch fixes it by calling reset_flow_sensitive_info_in_bb
if we optimize the guarding condition.
2025-10-04 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/122104
* tree-ssa-math-opts.cc (maybe_optimize_guarding_check): Call
reset_flow_sensitive_info_in_bb on bb when optimizing out the
guarding condition.
* gcc.target/i386/pr122104.c: New test.
(cherry picked from commit 867f777cee9f44027a3724fbad266c5cfb3a311f)
More information about the Gcc-bugs
mailing list