]> 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)
committerAndre Vieira <andre.simoesdiasvieira@arm.com>
Wed, 3 Feb 2021 10:02:38 +0000 (10:02 +0000)
commit320d8676c770124a4baffab2d9e82224c74964ed
tree0c95f157812643f71ebd430726f8cd284d14b86c
parentfff51bc4372ac5e7765647a29f461862bef4fc7d
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]