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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <[email protected]>:

https://gcc.gnu.org/g:99f37f7bea158264478c47a918ef06a9d777095e

commit r17-6782-g99f37f7bea158264478c47a918ef06a9d777095e
Author: Jakub Jelinek <[email protected]>
Date:   Sat Nov 28 19:14:36 2026 +0100

    bitintlower: Fix one argument IFN_CLZ/IFN_CTZ lowering [PR129081]

    When we lower one argument IFN_CLZ/IFN_CTZ (i.e. one which has UB on
    0), we emit __builtin_unreachable () in the bb corresponding to 0
    argument (otherwise there is an edge and PHI argument with the appropriate
    value for 0).
    Now, when IFN_CLZ/IFN_CTZ is called in a loop. that can result in loop
    verification ICE, because the bb in question where we stick the
    __builtin_unreachable () is created through split_block and inherits
    loop_father of the surrounding code.  But because we make the block
    noreturn, it should be part of the artificial loop 0, not any other
    loop.

    Fixed thusly.

    2026-11-28  Jakub Jelinek  <[email protected]>

            PR tree-optimization/129081
            * gimple-lower-bitint.cc (bitint_large_huge::lower_bit_query): Move
            bb with gimple_build_builtin_unreachable to get_loop (cfun, 0)
because
            it is noreturn.

            * gcc.dg/bitint-156.c: New test.

    Reviewed-by: 00~Jeff Law <[email protected]>

Reply via email to