This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] S/390: Add -mstack-size > 64k check
- From: Andreas Krebbel <krebbel1 at de dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 19 Oct 2005 10:12:21 +0200
- Subject: [PATCH] S/390: Add -mstack-size > 64k check
Hello,
the -mstack-size option on S/390 for performance reasons only supports
values with a maximum of 64k.
This patch adds an error message if that limit is exceeded and mentions
the limitation of the option in the documentation.
cc1 built and tested that the added check is triggered.
OK for mainline?
Bye,
-Andreas-
2005-10-19 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.c (override_options): Added check for -mstack-size
64k limitation.
* doc/invoke.texi: Mention that limit in the documenation.
Index: gcc/config/s390/s390.c
===================================================================
*** gcc/config/s390/s390.c.orig 2005-10-10 10:12:25.000000000 +0200
--- gcc/config/s390/s390.c 2005-10-19 09:58:49.000000000 +0200
*************** override_options (void)
*** 1385,1390 ****
--- 1385,1392 ----
error ("-mstack-size implies use of -mstack-guard");
else if (s390_stack_guard >= s390_stack_size)
error ("stack size must be greater than the stack guard value");
+ else if (s390_stack_size > 1 << 16)
+ error ("stack size must not be greater than 64k");
}
else if (s390_stack_guard)
error ("-mstack-guard implies use of -mstack-size");
Index: gcc/doc/invoke.texi
===================================================================
*** gcc/doc/invoke.texi.orig 2005-10-17 09:25:37.000000000 +0200
--- gcc/doc/invoke.texi 2005-10-19 10:12:03.000000000 +0200
*************** back end emits additional instructions i
*** 11659,11667 ****
if the stack size is @var{stack-guard} bytes above the @var{stack-size}
(remember that the stack on s390 grows downward). These options are intended to
be used to help debugging stack overflow problems. The additionally emitted code
! cause only little overhead and hence can also be used in production like systems
without greater performance degradation. The given values have to be exact
! powers of 2 and @var{stack-size} has to be greater than @var{stack-guard}.
In order to be efficient the extra code makes the assumption that the stack starts
at an address aligned to the value given by @var{stack-size}.
@end table
--- 11659,11668 ----
if the stack size is @var{stack-guard} bytes above the @var{stack-size}
(remember that the stack on s390 grows downward). These options are intended to
be used to help debugging stack overflow problems. The additionally emitted code
! causes only little overhead and hence can also be used in production like systems
without greater performance degradation. The given values have to be exact
! powers of 2 and @var{stack-size} has to be greater than @var{stack-guard} without
! exceeding 64k.
In order to be efficient the extra code makes the assumption that the stack starts
at an address aligned to the value given by @var{stack-size}.
@end table