]> git.ipfire.org Git - thirdparty/gcc.git/commit
vec-lowering: Fix ABSU lowering [PR111285]
authorAndrew Pinski <quic_apinski@quicinc.com>
Sun, 27 Oct 2024 20:16:22 +0000 (13:16 -0700)
committerAndrew Pinski <quic_apinski@quicinc.com>
Mon, 28 Oct 2024 08:17:02 +0000 (01:17 -0700)
commitad0084337e901ddaedd48c14e7a5dad9fc2a093e
tree7d4495a11d595486b0e21ed1e111208b71a2cc41
parent3f2739e4664fbb1026ff1ef9db2e8262d5f58cc2
vec-lowering: Fix ABSU lowering [PR111285]

ABSU_EXPR lowering incorrectly used the resulting type
for the new expression but in the case of ABSU the resulting
type is an unsigned type and with ABSU is folded away. The fix
is to use a signed type for the expression instead.

Bootstrapped and tested on x86_64-linux-gnu.

PR middle-end/111285

gcc/ChangeLog:

* tree-vect-generic.cc (do_unop): Use a signed type for the
operand if the operation was ABSU_EXPR.

gcc/testsuite/ChangeLog:

* g++.dg/torture/vect-absu-1.C: New test.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/testsuite/g++.dg/torture/vect-absu-1.C [new file with mode: 0644]
gcc/tree-vect-generic.cc