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

--- Comment #10 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:234d9acfd25aa3b74958e2f1c41e46d483b92d24

commit r17-330-g234d9acfd25aa3b74958e2f1c41e46d483b92d24
Author: Jakub Jelinek <[email protected]>
Date:   Tue May 5 10:45:37 2026 +0200

    testsuite: Fix up pr122569*.c tests [PR122569]

    On Tue, May 05, 2026 at 02:27:23PM +0800, H.J. Lu wrote:
    > The new tests failed with -m32 on Linux/x86-64:
    >
    > FAIL: gcc.dg/tree-ssa/pr122569-1.c scan-tree-dump forwprop1
    > "__builtin_ctz|\\.CTZ"
    > FAIL: gcc.dg/tree-ssa/pr122569-2.c scan-tree-dump forwprop1
    > "__builtin_clz|\\.CLZ"
    >
    > Should these tests require int128?

    They should first of all require ctzll resp. clzll effective targets,
    if there is a function call for those, then it certainly isn't optimized.

    The problem is that that isn't enough, ia32 is both ctzll and clzll
    effective target.  That is because we handle double-word __builtin_c[tl]zll
    by doing 2 word ops and one conditional.
    The tree-ssa-forwprop.cc optimization is checking for whether it can use
    IFN_CLZ/IFN_CTZ, and that is not the case, because we only use direct optab
    for that and don't have the double-word unop fallback for that.

    Rather than int128 I think it is more natural to test for lp64 || llp64.

    2026-05-05  Jakub Jelinek  <[email protected]>

            PR tree-optimization/122569
            * gcc.dg/tree-ssa/pr122569-1.c: Only require __builtin_ctz/.CTZ
            on ctzll 64-bit targets.
            * gcc.dg/tree-ssa/pr122569-2.c: Only require __builtin_clz/.CLZ
            on clzll 64-bit targets.

    Reviewed-by: Richard Biener <[email protected]>

Reply via email to