aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target
diff options
context:
space:
mode:
authorAndreas Krebbel <krebbel@linux.ibm.com>2020-05-14 08:16:27 +0200
committerAndreas Krebbel <krebbel@linux.ibm.com>2020-05-14 08:16:27 +0200
commit0473885be8b2a7aa0d5064a16c004116162f473f (patch)
tree622f63b224d544c7b07834cab5bfe023336c5214 /gcc/testsuite/gcc.target
parent868d351e232371eec4b40e83014a617d0d46f985 (diff)
downloadgcc-0473885be8b2a7aa0d5064a16c004116162f473f.zip
gcc-0473885be8b2a7aa0d5064a16c004116162f473f.tar.gz
gcc-0473885be8b2a7aa0d5064a16c004116162f473f.tar.bz2
IBM Z: Define probe_stack expander
Probes emitted by the common code routines still use a store. Define the "probe_stack" pattern to use a compare instead. gcc/ChangeLog: 2020-05-14 Andreas Krebbel <krebbel@linux.ibm.com> * config/s390/s390.c (s390_emit_stack_probe): Call the probe_stack expander. * config/s390/s390.md ("@probe_stack2<mode>", "probe_stack"): New expanders. gcc/testsuite/ChangeLog: 2020-05-14 Andreas Krebbel <krebbel@linux.ibm.com> * gcc.target/s390/stack-clash-2.c: New test.
Diffstat (limited to 'gcc/testsuite/gcc.target')
-rw-r--r--gcc/testsuite/gcc.target/s390/stack-clash-2.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/s390/stack-clash-2.c b/gcc/testsuite/gcc.target/s390/stack-clash-2.c
new file mode 100644
index 0000000..e554ad5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/stack-clash-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=z900 -fstack-clash-protection" } */
+
+extern void bar (char *);
+
+void
+foo ()
+{
+ char * mem = __builtin_alloca (20000);
+ bar (mem);
+}
+
+/* For alloca a common code routine emits the probes. Make sure the
+ "probe_stack" expander is used in that case. We want to use mem
+ compares instead of stores. */
+/* { dg-final { scan-assembler-times "cg\t" 5 { target lp64 } } } */
+/* { dg-final { scan-assembler-times "c\t" 5 { target { ! lp64 } } } } */