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

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

https://gcc.gnu.org/g:170fcbba4c97ea40750cc5c2fd0eb787311085f0

commit r17-2403-g170fcbba4c97ea40750cc5c2fd0eb787311085f0
Author: Hu, Lin1 <[email protected]>
Date:   Mon Jul 13 14:51:22 2026 +0800

    middle-end: use tree mode for masked cbranch operand [PR126221]

    emit_cmp_and_jump_insns used GET_MODE (expand_normal (masked_op)) to select
the
    mask mode.  For vector boolean constants that expand to CONST_INT, this
produces
    VOIDmode and triggers the assert mode != VOID_mode in
maybe_legitimize_operand.

    Use TYPE_MODE (TREE_TYPE (masked_op)), so the constant can be materialized
in
    the right mask mode.

    gcc/ChangeLog:

            PR middle-end/126203
            PR middle-end/126221
            PR middle-end/126232
            * optabs.cc (emit_cmp_and_jump_insns): Take the masked_op mode
            from TREE_TYPE (masked_op).

    gcc/testsuite/ChangeLog:

            PR middle-end/126203
            PR middle-end/126221
            PR middle-end/126232
            * gcc.target/i386/pr126221-1.c: New test.
            * gcc.target/i386/pr126221-2.c: Ditto.
            * gfortran.dg/pr126221.f90: Ditto.

Reply via email to