Skip to content

Commit 4702d3c

Browse files
author
Richard Earnshaw
committed
arm: Fix general issues with patterns for VLLDM and VLSTM
Both lazy_store_multiple_insn and lazy_load_multiple_insn contain invalid RTL (eg they contain a post_inc statement outside of a mem). What's more, the instructions concerned do not modify their input address register. We probably got away with this because they are generated so late in the compilation that no subsequent pass needed to understand them. Nevertheless, this could cause problems someday, so fixed to use a simple legal unspec. gcc: * config/arm/vfp.md (lazy_store_multiple_insn): Rewrite as valid RTL. (lazy_load_multiple_insn): Likewise.
1 parent 8da9b4f commit 4702d3c

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

gcc/config/arm/vfp.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,24 +1703,25 @@
17031703
(set_attr "type" "mov_reg")]
17041704
)
17051705
1706+
;; Both this and the next instruction are treated by GCC in the same
1707+
;; way as a blockage pattern. That's perhaps stronger than it needs
1708+
;; to be, but we do not want accesses to the VFP register bank to be
1709+
;; moved across either instruction.
1710+
17061711
(define_insn "lazy_store_multiple_insn"
1707-
[(set (match_operand:SI 0 "s_register_operand" "+&rk")
1708-
(post_dec:SI (match_dup 0)))
1709-
(unspec_volatile [(const_int 0)
1710-
(mem:SI (post_dec:SI (match_dup 0)))]
1711-
VUNSPEC_VLSTM)]
1712+
[(unspec_volatile
1713+
[(mem:BLK (match_operand:SI 0 "s_register_operand" "rk"))]
1714+
VUNSPEC_VLSTM)]
17121715
"use_cmse && reload_completed"
17131716
"vlstm%?\\t%0"
17141717
[(set_attr "predicable" "yes")
17151718
(set_attr "type" "store_4")]
17161719
)
17171720
17181721
(define_insn "lazy_load_multiple_insn"
1719-
[(set (match_operand:SI 0 "s_register_operand" "+&rk")
1720-
(post_inc:SI (match_dup 0)))
1721-
(unspec_volatile:SI [(const_int 0)
1722-
(mem:SI (match_dup 0))]
1723-
VUNSPEC_VLLDM)]
1722+
[(unspec_volatile
1723+
[(mem:BLK (match_operand:SI 0 "s_register_operand" "rk"))]
1724+
VUNSPEC_VLLDM)]
17241725
"use_cmse && reload_completed"
17251726
"vlldm%?\\t%0"
17261727
[(set_attr "predicable" "yes")

0 commit comments

Comments
 (0)