diff mbox series

[Committed] IBM Z: Define STACK_CHECK_MOVING_SP

Message ID 20211104184143.75981-1-krebbel@linux.ibm.com
State New
Headers show
Series [Committed] IBM Z: Define STACK_CHECK_MOVING_SP | expand

Commit Message

Andreas Krebbel Nov. 4, 2021, 6:41 p.m. UTC
With -fstack-check the stack probes emitted access memory below the
stack pointer.

Bootstrapped and regression tested on s390x.

Committed to mainline

gcc/ChangeLog:

	* config/s390/s390.h (STACK_CHECK_MOVING_SP): New macro
	definition.
---
 gcc/config/s390/s390.h | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index fb16a455a03..186c5c6200b 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -332,6 +332,11 @@  extern const char *s390_host_detect_local_cpu (int argc, const char **argv);
 
 #define STACK_SIZE_MODE (Pmode)
 
+/* Make the stack pointer to be moved downwards while issuing stack probes with
+   -fstack-check.  We need this to prevent memory below the stack pointer from
+   being accessed.  */
+#define STACK_CHECK_MOVING_SP 1
+
 #ifndef IN_LIBGCC2
 
 /* Width of a word, in units (bytes).  */