]> git.ipfire.org Git - thirdparty/gcc.git/commit
middle-end/117137 - expansion issue with vector equality compares
authorRichard Biener <rguenther@suse.de>
Tue, 15 Oct 2024 07:48:10 +0000 (09:48 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 15 Oct 2024 09:06:30 +0000 (11:06 +0200)
commit79b881df72c946f2ba61879c36ae93b0cb974617
treee7cbbf31c29bb73228d479ad49b74ed753b1de2f
parent8af474aa5d5efdda7def6cdcec3f246df2c7026a
middle-end/117137 - expansion issue with vector equality compares

When expanding a COND_EXPR with a vector equality compare as condition
expand_cond_expr_using_cmove fails to properly go the cbranch path.
I failed to massage it's twisted logic so the simple fix is to make
sure to expand a vector condition separately which also generates
the expected code for the testcase:

        ptest   %xmm0, %xmm0
        cmovne  %edi, %eax

PR middle-end/117137
* expr.cc (expand_cond_expr_using_cmove): Make sure to
expand vector comparisons separately.

* gcc.dg/torture/pr117137.c: New testcase.
gcc/expr.cc
gcc/testsuite/gcc.dg/torture/pr117137.c [new file with mode: 0644]