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

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

https://gcc.gnu.org/g:44c27171c36a9128da970fb35d4790de42a82b4d

commit r16-4735-g44c27171c36a9128da970fb35d4790de42a82b4d
Author: Artemiy Volkov <[email protected]>
Date:   Thu Oct 30 07:42:03 2025 -0600

    [PATCH][PR tree-optimization/122478] match.pd: fix simplify pattern for
view_convert (BIT_FIELD_REF)

    The pattern introduced in r16-4682-g5eafa8d16be873 couldn't handle
    conversion from <unnamed-unsigned:1> to unsigned char, which ended up
    causing a gimple checking failure reported in PR122478.  This patch fixes
    the pattern by prohibiting widening integral conversions in addition to
    the narrowing ones, or equivalently, requiring that the converted-to and
    converted-from types of the VCE both have precision equal to their size.
    Since type_has_mode_precision_p () does not apply to vector types, filter
    them out by adding a !INTEGRAL_TYPE_P () check on TREE_TYPE (@0).

    Bootstrapped and regtested on aarch64 and x86_64, regtested on i386 and
    riscv64, one GIMPLE test added.

            PR tree-optimization/122478

    gcc/ChangeLog:

            * match.pd: Fix the view_convert (BIT_FIELD_REF) pattern.

    gcc/testsuite/ChangeLog:

            * gcc.dg/tree-ssa/pr122478.c: New test.

Reply via email to