summaryrefslogtreecommitdiff
path: root/gcc/opts.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-16 18:40:57 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-16 18:40:57 +0000
commit4852b82934092d13e2b3e1a183a789e5e97f6729 (patch)
tree4ab818c332a67c5a5e24c9d78cedd1099ebc04e2 /gcc/opts.c
parent5ca16c548b7739e67ec4adc9a5ce233613eeb9d4 (diff)
downloadgcc-4852b82934092d13e2b3e1a183a789e5e97f6729.tar.gz
PR ada/20548
* common.opt (-fstack-check): Do not declare the variable here. (-fstack-check=): New option variant. * doc/invoke.texi (Code Gen Options): Document it. * expr.h (STACK_OLD_CHECK_PROTECT): New macro. (STACK_CHECK_PROTECT): Bump to 3 pages if DWARF-2 EH is used. (STACK_CHECK_STATIC_BUILTIN): New macro. * doc/tm.texi (Stack Checking): Document STACK_CHECK_STATIC_BUILTIN. * opts.c: Include expr.h. (common_handle_option) <OPT_fold_stack_check_>: New case. <OPT_fstack_check>: Likewise. * calls.c (initialize_argument_information): Use TYPE_SIZE_UNIT consistently in the test for variable-sized types. Adjust for new behaviour of flag_stack_check. * explow.c: Include except.h. (allocate_dynamic_stack_space): Do not take into account STACK_CHECK_MAX_FRAME_SIZE for static builtin stack checking. * function.c (gimplify_parameters): Use DECL_SIZE_UNIT in the test for variable-sized parameters. Treat all parameters whose size is greater than STACK_CHECK_MAX_VAR_SIZE as variable-sized if generic stack checking is enabled. * gimplify.c (gimplify_decl_expr): Treat non-static objects whose size is greater than STACK_CHECK_MAX_VAR_SIZE as variable-sized if generic stack checking is enabled. (expand_function_end): Adjust for new behaviour of flag_stack_check. * reload1.c (reload): Likewise. * stmt.c (expand_decl): Assert that all automatic variables have fixed size at this point and remove dead code. * flags.h (stack_check_type): New enumeration type. (flag_stack_check): Declare. * toplev.c (flag_stack_check): New global variable. * Makefile.in (opts.o): Add dependency on EXPR_H. (explow.o): Add dependency on except.h. ada/ * gcc-interface/decl.c (gnat_to_gnu_entity): Use DECL_SIZE_UNIT in the setjmp test consistently. Adjust for new behaviour of flag_stack_check. * gcc-interface/utils2.c (build_call_alloc_dealloc): Remove redundant test of flag_stack_check. Adjust for new behaviour of flag_stack_check. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139159 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opts.c')
-rw-r--r--gcc/opts.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/opts.c b/gcc/opts.c
index 8dd8b8265fd..7d582297eb6 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h"
#include "tree.h"
#include "rtl.h"
+#include "expr.h"
#include "ggc.h"
#include "output.h"
#include "langhooks.h"
@@ -1900,6 +1901,37 @@ common_handle_option (size_t scode, const char *arg, int value,
flag_sched_stalled_insns_dep = value;
break;
+ case OPT_fstack_check_:
+ if (!strcmp (arg, "no"))
+ flag_stack_check = NO_STACK_CHECK;
+ else if (!strcmp (arg, "generic"))
+ /* This is the old stack checking method. */
+ flag_stack_check = STACK_CHECK_BUILTIN
+ ? FULL_BUILTIN_STACK_CHECK
+ : GENERIC_STACK_CHECK;
+ else if (!strcmp (arg, "specific"))
+ /* This is the new stack checking method. */
+ flag_stack_check = STACK_CHECK_BUILTIN
+ ? FULL_BUILTIN_STACK_CHECK
+ : STACK_CHECK_STATIC_BUILTIN
+ ? STATIC_BUILTIN_STACK_CHECK
+ : GENERIC_STACK_CHECK;
+ else
+ warning (0, "unknown stack check parameter \"%s\"", arg);
+ break;
+
+ case OPT_fstack_check:
+ /* This is the same as the "specific" mode above. */
+ if (value)
+ flag_stack_check = STACK_CHECK_BUILTIN
+ ? FULL_BUILTIN_STACK_CHECK
+ : STACK_CHECK_STATIC_BUILTIN
+ ? STATIC_BUILTIN_STACK_CHECK
+ : GENERIC_STACK_CHECK;
+ else
+ flag_stack_check = NO_STACK_CHECK;
+ break;
+
case OPT_fstack_limit:
/* The real switch is -fno-stack-limit. */
if (value)