]> git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: Fix wrong code with <optab>_alsl_reversesi_extended
authorXi Ruoyao <xry111@xry111.site>
Tue, 21 Jan 2025 15:01:38 +0000 (23:01 +0800)
committerXi Ruoyao <xry111@xry111.site>
Wed, 22 Jan 2025 08:41:38 +0000 (16:41 +0800)
commit8c93a8aa67f12c8e03eb7fd90f671a03ae46935b
tree5ddb1d07e713099d70e416726695bc0053f85369
parent14fde9162dfdcd497f17fa799abce1146263893f
LoongArch: Fix wrong code with <optab>_alsl_reversesi_extended

The second source register of this insn cannot be the same as the
destination register.

gcc/ChangeLog:

* config/loongarch/loongarch.md
(<optab>_alsl_reversesi_extended): Add '&' to the destination
register constraint and append '0' to the first source register
constraint to indicate the destination register cannot be same
as the second source register, and change the split condition to
reload_completed so that the insn will be split only after RA in
order to obtain allocated registers that satisfy the above
constraints.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/bitwise-shift-reassoc-clobber.c: New
test.
gcc/config/loongarch/loongarch.md
gcc/testsuite/gcc.target/loongarch/bitwise-shift-reassoc-clobber.c [new file with mode: 0644]