diff mbox series

PowerPC -mcpu=future Patch 7 of 7, Add test for stack checking and large stack frames

Message ID 20200427200424.GG24986@ibm-tinman.the-meissners.org
State New
Headers show
Series PowerPC -mcpu=future Patch 7 of 7, Add test for stack checking and large stack frames | expand

Commit Message

Michael Meissner April 27, 2020, 8:04 p.m. UTC
This patch adds a test for the case where we have prefixed load/store
instructions, a large stack frame, and stack checking is enabled.

This is patch #7 of 7.  I have checked this patch on a little endian power8
system running Linux, and the test passed.  Can I check this into the GCC 10
trunk?

2020-04-27  Michael Meissner  <meissner@linux.ibm.com>

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

Comments

will schmidt April 27, 2020, 10:28 p.m. UTC | #1
On Mon, 2020-04-27 at 16:04 -0400, Michael Meissner via Gcc-patches wrote:
> This patch adds a test for the case where we have prefixed load/store
> instructions, a large stack frame, and stack checking is enabled.
> 
> This is patch #7 of 7.  I have checked this patch on a little endian power8
> system running Linux, and the test passed.  Can I check this into the GCC 10
> trunk?
> 
> 2020-04-27  Michael Meissner  <meissner@linux.ibm.com>
> 
> 	* gcc.target/powerpc/prefix-stack-protect.c: New test to make sure
> 	-fstack-protect-strong works with prefixed addressing.
> 
> --- /tmp/OxuBEg_prefix-stack-protect.c	2020-04-27 14:12:53.883004507 -0400
> +++ gcc/testsuite/gcc.target/powerpc/prefix-stack-protect.c	2020-04-27 14:12:53.706006931 -0400
> @@ -0,0 +1,20 @@
> +/* { dg-do compile } */
> +/* { dg-require-effective-target powerpc_prefixed_addr } */
> +/* { dg-options "-O2 -mdejagnu-cpu=future -fstack-protector-strong" } */
> +
> +/* Test that we can handle large stack frames with -fstack-protector-strong and
> +   prefixed addressing.  This was originally discovered in trying to build

s/in/when/

> +   glibc with -mcpu=future, and vfwprintf.c failed because it used
> +   -fstack-protector-strong.  */
> +
> +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} } } */
> 

lgtm,
thanks,
-Will
diff mbox series

Patch

--- /tmp/OxuBEg_prefix-stack-protect.c	2020-04-27 14:12:53.883004507 -0400
+++ gcc/testsuite/gcc.target/powerpc/prefix-stack-protect.c	2020-04-27 14:12:53.706006931 -0400
@@ -0,0 +1,20 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-options "-O2 -mdejagnu-cpu=future -fstack-protector-strong" } */
+
+/* Test that we can handle large stack frames with -fstack-protector-strong and
+   prefixed addressing.  This was originally discovered in trying to build
+   glibc with -mcpu=future, and vfwprintf.c failed because it used
+   -fstack-protector-strong.  */
+
+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} } } */