]> git.ipfire.org Git - thirdparty/gcc.git/commit
arm: Fix up neon_vector_mem_operand [PR97528]
authorJakub Jelinek <jakub@redhat.com>
Fri, 20 Nov 2020 11:26:58 +0000 (12:26 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 25 Nov 2020 11:55:22 +0000 (12:55 +0100)
commit05a3ab76e03ec6cff0bafb8495387b3a186785cc
treefe4c7fe4eb81e8628b48d19e2ab2495eb5b7abfc
parent812258b07c1a80e8dc79a0beb3ec0e17be62f5e5
arm: Fix up neon_vector_mem_operand [PR97528]

The documentation for POST_MODIFY says:
   Currently, the compiler can only handle second operands of the
   form (plus (reg) (reg)) and (plus (reg) (const_int)), where
   the first operand of the PLUS has to be the same register as
   the first operand of the *_MODIFY.
The following testcase ICEs, because combine just attempts to simplify
things and ends up with
(post_modify (reg1) (plus (mult (reg2) (const_int 4)) (reg1))
but the target predicates accept it, because they only verify
that POST_MODIFY's second operand is PLUS and the second operand
of the PLUS is a REG.

The following patch fixes this by performing further verification that
the POST_MODIFY is in the form it should be.

2020-11-20  Jakub Jelinek  <jakub@redhat.com>

PR target/97528
* config/arm/arm.c (neon_vector_mem_operand): For POST_MODIFY, require
first POST_MODIFY operand is a REG and is equal to the first operand
of PLUS.

* gcc.target/arm/pr97528.c: New test.

(cherry picked from commit 410b8f6f41920dad200cd709f9f3de8b840a995c)
gcc/config/arm/arm.c
gcc/testsuite/gcc.target/arm/pr97528.c [new file with mode: 0644]