diff mbox series

, V8, #6 of #6, Testsuite: Test -fstack-protect-strong works with prefixed addressing

Message ID 20191115002644.GF19187@ibm-toto.the-meissners.org
State New
Headers show
Series , V8, #6 of #6, Testsuite: Test -fstack-protect-strong works with prefixed addressing | expand

Commit Message

Michael Meissner Nov. 15, 2019, 12:26 a.m. UTC
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  <meissner@linux.ibm.com>

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

Comments

Segher Boessenkool Dec. 2, 2019, 9:52 p.m. UTC | #1
Hi Mike,

On Thu, Nov 14, 2019 at 07:26:44PM -0500, Michael Meissner wrote:
> 	* gcc.target/powerpc/prefix-stack-protect.c: New test to make sure
> 	-fstack-protect-strong works with prefixed addressing.

The option is -fstack-protector-strong.  But what is tested is equally
true for any use of the stack protector, whichever subflag is used, so
it should just say that (and in the changelog, just "New test.").

> --- /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} } } */

So what it actually tests is if we use prefixed loads and stores for
the stack protector generated code?


Segher
diff mbox series

Patch

--- /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} } } */