+2019-08-27 Richard Earnshaw <rearnsha@arm.com>
+
+ * config/arm/arm.md (stack_protect_set_insn): Add security-related
+ comment.
+ * config/aarch64/aarch64.md (stack_protect_set_<mode>): Likewise.
+
2019-08-27 Martin Liska <mliska@suse.cz>
* cgraph.c (cgraph_node::remove): Remove dead assignment before
}
[(set_attr "type" "mrs")])
+;; DO NOT SPLIT THIS PATTERN. It is important for security reasons that the
+;; canary value does not live beyond the life of this sequence.
(define_insn "stack_protect_set_<mode>"
[(set (match_operand:PTR 0 "memory_operand" "=m")
(unspec:PTR [(match_operand:PTR 1 "memory_operand" "m")]
UNSPEC_SP_SET))
(set (match_scratch:PTR 2 "=&r") (const_int 0))]
""
- "ldr\\t%<w>2, %1\;str\\t%<w>2, %0\;mov\t%<w>2,0"
+ "ldr\\t%<w>2, %1\;str\\t%<w>2, %0\;mov\t%<w>2, 0"
[(set_attr "length" "12")
(set_attr "type" "multiple")])
[(set_attr "arch" "t1,32")]
)
+;; DO NOT SPLIT THIS INSN. It's important for security reasons that the
+;; canary value does not live beyond the life of this sequence.
(define_insn "*stack_protect_set_insn"
[(set (match_operand:SI 0 "memory_operand" "=m,m")
(unspec:SI [(mem:SI (match_operand:SI 1 "register_operand" "+&l,&r"))]
(clobber (match_dup 1))]
""
"@
- ldr\\t%1, [%1]\;str\\t%1, %0\;movs\t%1,#0
- ldr\\t%1, [%1]\;str\\t%1, %0\;mov\t%1,#0"
+ ldr\\t%1, [%1]\;str\\t%1, %0\;movs\t%1, #0
+ ldr\\t%1, [%1]\;str\\t%1, %0\;mov\t%1, #0"
[(set_attr "length" "8,12")
(set_attr "conds" "clob,nocond")
(set_attr "type" "multiple")