]> git.ipfire.org Git - thirdparty/gcc.git/commit
arm: fully validate mem_noofs_operand [PR120351]
authorRichard Earnshaw <rearnsha@arm.com>
Mon, 19 May 2025 15:19:39 +0000 (16:19 +0100)
committerRichard Earnshaw <rearnsha@arm.com>
Mon, 19 May 2025 16:37:17 +0000 (17:37 +0100)
commite5bb7a328eb71daa02d15b48d3a6c6b8cd24abc5
tree0c85e477bea9bf10c31fcd1f80e1805c4f5a48d4
parent1197f896ae5558f27baa929a10f66447aaafb681
arm: fully validate mem_noofs_operand [PR120351]

It's not enough to just check that a memory operand is of the form
mem(reg); after RA we also need to validate the register being used.
The safest way to do this is to call memory_operand.

PR target/120351

gcc/ChangeLog:

* config/arm/predicates.md (mem_noofs_operand): Also check the op
is a valid memory_operand.

gcc/testsuite/ChangeLog:

* gcc.target/arm/pr120351.c: New test.
gcc/config/arm/predicates.md
gcc/testsuite/gcc.target/arm/pr120351.c [new file with mode: 0644]