]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix incorrect optimization by cprop_hardreg.
authorliuhongt <hongtao.liu@intel.com>
Mon, 18 Jan 2021 08:55:32 +0000 (16:55 +0800)
committerJakub Jelinek <jakub@redhat.com>
Tue, 10 May 2022 08:14:22 +0000 (10:14 +0200)
commit0372a414e7500dccab1eb423a2a620645c820a52
treeb04754e82de8e5ef342cdede5157fdec56d48098
parent3a32d7258f498076d0d8aa998a069f5c1c58c6b5
Fix incorrect optimization by cprop_hardreg.

If SRC had been assigned a mode narrower than the copy, we can't
always link DEST into the chain even they have same
hard_regno_nregs(i.e. HImode/SImode in i386 backend).

i.e
        kmovw   %k0, %edi
        vmovd   %edi, %xmm2
vpshuflw        $0, %xmm2, %xmm0
        kmovw   %k0, %r8d
        kmovd   %k0, %r9d
...
-  movl %r9d, %r11d
+  vmovd %xmm2, %r11d

gcc/ChangeLog:

PR rtl-optimization/98694
* regcprop.c (copy_value): If SRC had been assigned a mode
narrower than the copy, we can't link DEST into the chain even
they have same hard_regno_nregs(i.e. HImode/SImode in i386
backend).

gcc/testsuite/ChangeLog:

PR rtl-optimization/98694
* gcc.target/i386/pr98694.c: New test.

(cherry picked from commit e711b67a9081ae84c66174a50705dc98ba993a43)
gcc/regcprop.c
gcc/testsuite/gcc.target/i386/pr98694.c [new file with mode: 0644]