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

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

https://gcc.gnu.org/g:0accf2b4dff933915ae75a154d268c79fc7ea5b9

commit r16-7068-g0accf2b4dff933915ae75a154d268c79fc7ea5b9
Author: Robin Dapp <[email protected]>
Date:   Sat Jan 24 22:07:07 2026 +0100

    forwprop: Pun with integer type if needed [PR123799].

    We cannot directly build vectors from BitInts, which this patch
    circumvents by punning  the conversion element type with an integer
    type.  This results in two separate conversions at the gimple level.
    Those don't appear to cause worse final code, though.  It is possible to
    merge those two conversions at the construction site but from what I can
    tell would involve more changes than necessary now, so I refrained from
    it.

    Before this patch we would check tree_nop_conversion_p for e.g.
    BitInt _12 = BIT_FIELD_REF (vector unsigned int).  This is a
    "nop conversion" but the implicit assumption is that we can build
    a vector type from the lhs type that can be nop-converted back to
    the original type.  This is not true for BitInt.

    Bootstrapped and regtested on x86, power10, and aarch64.
    Regtested on riscv64.

            PR tree-optimization/123799

    gcc/ChangeLog:

            * tree-ssa-forwprop.cc (simplify_vector_constructor): Pun
            conversion element type with integer type.

    gcc/testsuite/ChangeLog:

            * gcc.dg/torture/pr123799.c: New test.

Reply via email to