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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>:

https://gcc.gnu.org/g:ceae1400cf24f329393e96dd9720b0391afe858d

commit r14-2667-gceae1400cf24f329393e96dd9720b0391afe858d
Author: Richard Biener <rguent...@suse.de>
Date:   Tue Jul 18 13:19:11 2023 +0200

    middle-end/61747 - conditional move expansion and constants

    When expanding a COND_EXPR or a VEC_COND_EXPR the x86 backend for
    example tries to match FP min/max instructions.  But this only
    works when it can see the equality of the comparison and selected
    operands.  This breaks in both prepare_cmp_insn and vector_compare_rtx
    where the former forces expensive constants to a register and the
    latter performs legitimization.  The patch below fixes this in
    the caller preserving former equalities.

            PR middle-end/61747
            * internal-fn.cc (expand_vec_cond_optab_fn): When the
            value operands are equal to the original comparison operands
            preserve that equality by re-using the comparison expansion.
            * optabs.cc (emit_conditional_move): When the value operands
            are equal to the comparison operands and would be forced to
            a register by prepare_cmp_insn do so earlier, preserving the
            equality.

            * g++.target/i386/pr61747.C: New testcase.

Reply via email to