@@ -4031,7 +4031,7 @@ (define_insn "stack_protect_test_<mode>"
(unspec:PTR [(match_operand:PTR 1 "memory_operand" "m")
(match_operand:PTR 2 "memory_operand" "m")]
UNSPEC_SP_TEST))
- (clobber (match_scratch:PTR 3 "&r"))]
+ (clobber (match_scratch:PTR 3 "=&r"))]
""
"ldr\t%<w>3, %x1\;ldr\t%<w>0, %x2\;eor\t%<w>0, %<w>3, %<w>0"
[(set_attr "length" "12")
new file mode 100644
@@ -0,0 +1,16 @@
+/* { dg-do assemble } */
+/* { dg-options "-fstack-protector-strong -O1 -frename-registers" } */
+/* { dg-require-effective-target fstack_protector } */
+
+extern int bar (const char *s, int *argc);
+extern int baz (const char *s);
+
+char
+foo (const char *s)
+{
+ int argc;
+ int ret;
+ if ( !bar (s, &argc))
+ ret = baz (s);
+ return *s;
+}
new file mode 100644
@@ -0,0 +1,18 @@
+/* { dg-do assemble } */
+/* { dg-options "-fstack-protector-strong -O1 -frename-registers" } */
+/* { dg-require-effective-target fstack_protector } */
+
+typedef unsigned int uint32_t;
+struct ctx
+{
+ uint32_t A;
+};
+
+void *
+buffer_copy (const struct ctx *ctx, void *resbuf)
+{
+ uint32_t buffer[4];
+ buffer[0] = (ctx->A);
+ __builtin_memcpy (resbuf, buffer, sizeof (buffer));
+ return resbuf;
+}