]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix PR 110042: ifcvt regression due to paradoxical subregs
authorAndrew Pinski <apinski@marvell.com>
Tue, 30 May 2023 22:54:32 +0000 (15:54 -0700)
committerAndrew Pinski <apinski@marvell.com>
Fri, 2 Jun 2023 19:22:13 +0000 (19:22 +0000)
commitdf0853d72d38247aed577a4511450c91794f2f06
tree9636e8099fb9e99afe89496f3736aa46516c88f8
parent84d080a29a780973bef47171ba708ae2f7b4ee47
Fix PR 110042: ifcvt regression due to paradoxical subregs

After r14-1014-gc5df248509b489364c573e8, GCC started to emit
directly a zero_extract for `(t1&0x8)!=0`. This introduced
a small regression where ifcvt would not do the ifconversion
as there is now a paradoxical subreg in the dest which
was being rejected. Since paradoxical subreg set the whole
register, we can treat it as the same as a reg in the two places.

OK? Bootstrapped and tested on x86_64-linux-gnu and aarch64-linux-gnu.

gcc/ChangeLog:

PR rtl-optimization/110042
* ifcvt.cc (bbs_ok_for_cmove_arith): Allow paradoxical subregs.
(bb_valid_for_noce_process_p): Strip the subreg for the SET_DEST.

gcc/testsuite/ChangeLog:

PR rtl-optimization/110042
* gcc.target/aarch64/csel_bfx_2.c: New test.
gcc/ifcvt.cc
gcc/testsuite/gcc.target/aarch64/csel_bfx_2.c [new file with mode: 0644]