This patch checks whether the -fstack-protect-strong option works with a large
stack frame on -mcpu=future systems where prefixed instructions are generated.

Can I check this into the FSF trunk?

2019-11-14  Michael Meissner  <meiss...@linux.ibm.com>

        * gcc.target/powerpc/prefix-stack-protect.c: New test to make sure
        -fstack-protect-strong works with prefixed addressing.

--- /tmp/byVdyb_prefix-stack-protect.c  2019-11-13 17:45:35.374176204 -0500
+++ gcc/testsuite/gcc.target/powerpc/prefix-stack-protect.c     2019-11-13 
17:45:35.143174125 -0500
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr_ok } */
+/* { dg-options "-O2 -mdejagnu-cpu=future -fstack-protector-strong" } */
+
+/* Test that we can handle large stack frames with -fstack-protector-strong and
+   prefixed addressing.  */
+
+extern long foo (char *);
+
+long
+bar (void)
+{
+  char buffer[0x20000];
+  return foo (buffer) + 1;
+}
+
+/* { dg-final { scan-assembler {\mpld\M}  } } */
+/* { dg-final { scan-assembler {\mpstd\M} } } */

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.ibm.com, phone: +1 (978) 899-4797

Reply via email to