]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix PR 110386: backprop vs ABSU_EXPR
authorAndrew Pinski <apinski@marvell.com>
Sun, 24 Sep 2023 04:53:09 +0000 (21:53 -0700)
committerAndrew Pinski <quic_apinski@quicinc.com>
Thu, 9 May 2024 07:22:53 +0000 (00:22 -0700)
commitf5c7306d7f039e5c74c5e82cf06610f0ae07a0e8
tree84438d6f017cab4b9154880f4db48c9828d07dd3
parent58d11bfc27d5412619c0919738158a4c05cca2cf
Fix PR 110386: backprop vs ABSU_EXPR

The issue here is that when backprop tries to go
and strip sign ops, it skips over ABSU_EXPR but
ABSU_EXPR not only does an ABS, it also changes the
type to unsigned.
Since strip_sign_op_1 is only supposed to strip off
sign changing operands and not ones that change types,
removing ABSU_EXPR here is correct. We don't handle
nop conversions so this does cause any missed optimizations either.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

PR tree-optimization/110386

gcc/ChangeLog:

* gimple-ssa-backprop.cc (strip_sign_op_1): Remove ABSU_EXPR.

gcc/testsuite/ChangeLog:

* gcc.c-torture/compile/pr110386-1.c: New test.
* gcc.c-torture/compile/pr110386-2.c: New test.

(cherry picked from commit 2bbac12ea7bd8a3eef5382e1b13f6019df4ec03f)
gcc/gimple-ssa-backprop.cc
gcc/testsuite/gcc.c-torture/compile/pr110386-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/pr110386-2.c [new file with mode: 0644]