diff options
author | Richard Biener <rguenther@suse.de> | 2023-07-18 13:19:11 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2023-07-20 09:50:43 +0200 |
commit | ceae1400cf24f329393e96dd9720b0391afe858d (patch) | |
tree | 44d0c07e2012d866c88c53d899fd464385ec77be /gcc/builtins.cc | |
parent | bb0da4542df887a530d5a75e08abf5cbb821fe6b (diff) | |
download | gcc-ceae1400cf24f329393e96dd9720b0391afe858d.zip gcc-ceae1400cf24f329393e96dd9720b0391afe858d.tar.gz gcc-ceae1400cf24f329393e96dd9720b0391afe858d.tar.bz2 |
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.
Diffstat (limited to 'gcc/builtins.cc')
0 files changed, 0 insertions, 0 deletions