From c55721c0dfee6d4de107cab63bfe0d1ebf5bdfde Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 15 Sep 2015 16:25:59 +0000 Subject: [PATCH] defaults.h (STACK_OLD_CHECK_PROTECT): Adjust for -fno-exceptions. * defaults.h (STACK_OLD_CHECK_PROTECT): Adjust for -fno-exceptions. Bump to 4KB for SJLJ exceptions. (STACK_CHECK_PROTECT): Likewise. Bump to 8KB for SJLJ exceptions. * doc/tm.texi.in (STACK_CHECK_PROTECT): Adjust. * doc/tm.texi: Regenerate. From-SVN: r227799 --- gcc/ChangeLog | 8 ++++++++ gcc/defaults.h | 14 +++++++++----- gcc/doc/tm.texi | 6 +++--- gcc/doc/tm.texi.in | 6 +++--- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6f60273a86d..0305ca80d73 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2015-09-15 Eric Botcazou + + * defaults.h (STACK_OLD_CHECK_PROTECT): Adjust for -fno-exceptions. + Bump to 4KB for SJLJ exceptions. + (STACK_CHECK_PROTECT): Likewise. Bump to 8KB for SJLJ exceptions. + * doc/tm.texi.in (STACK_CHECK_PROTECT): Adjust. + * doc/tm.texi: Regenerate. + 2015-09-15 Kyrylo Tkachov * config/arm/arm.c (arm_gen_constant): Use HOST_WIDE_INT_M1U instead diff --git a/gcc/defaults.h b/gcc/defaults.h index d4d3a565c17..9ca9df2e117 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -1406,9 +1406,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define STACK_OLD_CHECK_PROTECT STACK_CHECK_PROTECT #else #define STACK_OLD_CHECK_PROTECT \ - (targetm_common.except_unwind_info (&global_options) == UI_SJLJ \ + (!global_options.x_flag_exceptions \ ? 75 * UNITS_PER_WORD \ - : 8 * 1024) + : targetm_common.except_unwind_info (&global_options) == UI_SJLJ \ + ? 4 * 1024 \ + : 8 * 1024) #endif /* Minimum amount of stack required to recover from an anticipated stack @@ -1416,9 +1418,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see of stack required to propagate an exception. */ #ifndef STACK_CHECK_PROTECT #define STACK_CHECK_PROTECT \ - (targetm_common.except_unwind_info (&global_options) == UI_SJLJ \ - ? 75 * UNITS_PER_WORD \ - : 12 * 1024) + (!global_options.x_flag_exceptions \ + ? 4 * 1024 \ + : targetm_common.except_unwind_info (&global_options) == UI_SJLJ \ + ? 8 * 1024 \ + : 12 * 1024) #endif /* Make the maximum frame size be the largest we can and still only need diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index d548d96b234..65fb8656a18 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -3360,10 +3360,10 @@ default value of this macro is zero. @defmac STACK_CHECK_PROTECT The number of bytes of stack needed to recover from a stack overflow, for -languages where such a recovery is supported. The default value of 75 words +languages where such a recovery is supported. The default value of 4KB/8KB with the @code{setjmp}/@code{longjmp}-based exception handling mechanism and -8192 bytes with other exception handling mechanisms should be adequate for -most machines. +8KB/12KB with other exception handling mechanisms should be adequate for most +architectures and operating systems. @end defmac The following macros are relevant only if neither STACK_CHECK_BUILTIN diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 9bef4a59bed..8fe193c4f25 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -2946,10 +2946,10 @@ default value of this macro is zero. @defmac STACK_CHECK_PROTECT The number of bytes of stack needed to recover from a stack overflow, for -languages where such a recovery is supported. The default value of 75 words +languages where such a recovery is supported. The default value of 4KB/8KB with the @code{setjmp}/@code{longjmp}-based exception handling mechanism and -8192 bytes with other exception handling mechanisms should be adequate for -most machines. +8KB/12KB with other exception handling mechanisms should be adequate for most +architectures and operating systems. @end defmac The following macros are relevant only if neither STACK_CHECK_BUILTIN -- 2.30.2