]> gcc.gnu.org Git - gcc.git/commit
aarch64: PR target/99822 Don't allow zero register in first operand of SUBS/ADDS...
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Tue, 30 Mar 2021 14:43:36 +0000 (15:43 +0100)
committerKyrylo Tkachov <kyrylo.tkachov@arm.com>
Tue, 30 Mar 2021 14:43:36 +0000 (15:43 +0100)
commit19199a6f2b0f4ce4b100856c78706d56a16b1956
treef2d8b40b2c33cc40cd67c9bac772184ed94315b5
parentf64b91568f3ac8f152c6c617b4fcc6b51da10ac4
aarch64: PR target/99822 Don't allow zero register in first operand of SUBS/ADDS-immediate

In this PR we end up generating an invalid instruction:
adds x1,xzr,#2

because the pattern accepts zero as an operand in the comparison, but the instruction doesn't.
Fix it by adjusting the predicate and constraints.

gcc/ChangeLog:

PR target/99822
* config/aarch64/aarch64.md (sub<mode>3_compare1_imm): Do not allow zero
in operand 1.

gcc/testsuite/ChangeLog:

PR target/99822
* gcc.c-torture/compile/pr99822.c: New test.
gcc/config/aarch64/aarch64.md
gcc/testsuite/gcc.c-torture/compile/pr99822.c [new file with mode: 0644]
This page took 0.057356 seconds and 5 git commands to generate.