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

--- Comment #18 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by hongtao Liu
<[email protected]>:

https://gcc.gnu.org/g:d135ff4f42672b11b5bfdc2a5a447f3919b3d331

commit r16-9781-gd135ff4f42672b11b5bfdc2a5a447f3919b3d331
Author: liuhongt <[email protected]>
Date:   Mon Sep 14 23:51:26 2026 -0700

    match.pd: Check cond_expr_convert_p operand precision [PR127382]

    cond_expr_convert_p compared the selected operands only by TYPE_SIZE.
    For integral operands this could build a COND_EXPR whose arms have
    different precision, e.g. unsigned _BitInt(17) vs unsigned int, which
    ICEs in range analysis.

    Require the integral arms to be nop-convertible to each other instead,
    which still allows them to differ in sign.

            PR tree-optimization/127382

    gcc/ChangeLog:

            * match.pd (cond_expr_convert_p): Use tree_nop_conversion_p
            instead of INTEGRAL_TYPE_P to check the integral selected
            operands.

    gcc/testsuite/ChangeLog:

            * gcc.dg/bitint-146.c: New test.
            * gcc.target/i386/pr127382.c: Likewise.

    (cherry picked from commit 164e45f035160df9e3eac7decb8202ba098e2f3c)

Reply via email to