]> git.ipfire.org Git - thirdparty/gcc.git/commit
Arm: Fix disassembly error in Thumb-1 relaxed load/store [PR115188]
authorWilco Dijkstra <wilco.dijkstra@arm.com>
Tue, 2 Jul 2024 16:37:04 +0000 (17:37 +0100)
committerWilco Dijkstra <wilco.dijkstra@arm.com>
Tue, 2 Jul 2024 17:01:56 +0000 (18:01 +0100)
commitd04c5537f5ae4a3acd3f5135347d7e2d8c218811
tree20f07221674cd862f3140780dd1afb9828c8fc6b
parentbd9c550acc42c5b04a61be3c8d981359b2093357
Arm: Fix disassembly error in Thumb-1 relaxed load/store [PR115188]

A Thumb-1 memory operand allows single-register LDMIA/STMIA. This doesn't get
printed as LDR/STR with writeback in unified syntax, resulting in strange
assembler errors if writeback is selected.  To work around this, use the 'Uw'
constraint that blocks writeback.  Also use a new 'mem_and_no_t1_wback_op'
which is a general memory operand that disallows writeback in Thumb-1.
A few other patterns were using 'm' for Thumb-1 in a similar way, update these
to also use 'mem_and_no_t1_wback_op' and 'Uw'.

gcc:
PR target/115188
* config/arm/arm.md (unaligned_loadsi): Use 'Uw' constraint and
'mem_and_no_t1_wback_op'.
(unaligned_loadhiu): Likewise.
(unaligned_storesi): Likewise.
(unaligned_storehi): Likewise.
* config/arm/predicates.md (mem_and_no_t1_wback_op): Add new predicate.
* config/arm/sync.md (arm_atomic_load<mode>): Use 'Uw' constraint.
(arm_atomic_store<mode>): Likewise.

gcc/testsuite:
PR target/115188
* gcc.target/arm/pr115188.c: Add new test.
gcc/config/arm/arm.md
gcc/config/arm/predicates.md
gcc/config/arm/sync.md
gcc/testsuite/gcc.target/arm/pr115188.c [new file with mode: 0644]