[Bug ipa/124128] [15/16 Regression] ICE in intersect, at value-range.cc:2043 since r15-6294

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jul 22 14:14:17 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124128

--- Comment #19 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Martin Jambor
<jamborm@gcc.gnu.org>:

https://gcc.gnu.org/g:7b1b3c5de2a78ba43e61b24d6ffac47fde2c8fbf

commit r15-11409-g7b1b3c5de2a78ba43e61b24d6ffac47fde2c8fbf
Author: Martin Jambor <mjambor@suse.cz>
Date:   Thu Jun 18 14:55:33 2026 +0200

    ipa-cp: Fix ipa-vr intersection in wrong type (PR124128)

    Function ipa_vr_intersect_with_arith_jfunc in ipa-cp.cc contains a
    check

      if (src_type == dst_type)

    which should have been

      if (operation_type == dst_type)

    which lead to an ICE in the ranger machinery as it tried to intersect
    a signed and an unsigned integer when compiling the testcases from
    PR124128.

    The condition itself is basically an early exit to avoid calling yet
    another ipa_vr_operation_and_type_effects to type-convert the value
    range when we already can simply compare the types and see we already
    have the righ thing.  A better place for it is however just before
    that conversion, where it can also avoid the call when dealing with
    the most simple of pass-through jump functions (and where it generally
    "makes more sense") so this is what the patch does.

    gcc/ChangeLog:

    2026-06-04  Martin Jambor  <mjambor@suse.cz>

            PR ipa/124128
            * ipa-cp.cc (ipa_vr_intersect_with_arith_jfunc): Move the check if
            the final type conversion needs to happen before the conversion.

    gcc/testsuite/ChangeLog:

    2026-06-04  Martin Jambor  <mjambor@suse.cz>

            PR ipa/124128
            * gcc.dg/ipa/pr124128.c: New test.

    (cherry picked from commit 281b8d054f6b98386f3ecd8a1e82a3374dd9d674)


More information about the Gcc-bugs mailing list