diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2008-08-16 18:40:57 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2008-08-16 18:40:57 +0000 |
commit | b38f3813f7ba380b33607e114a7efa9901191924 (patch) | |
tree | 4ab818c332a67c5a5e24c9d78cedd1099ebc04e2 /gcc/explow.c | |
parent | 6c397102b275823c0d8ffb02ab7d74bb38ede5a9 (diff) | |
download | gcc-b38f3813f7ba380b33607e114a7efa9901191924.zip gcc-b38f3813f7ba380b33607e114a7efa9901191924.tar.gz gcc-b38f3813f7ba380b33607e114a7efa9901191924.tar.bz2 |
re PR middle-end/20548 (ACATS c52103x c52104x c52104y segfault)
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.
From-SVN: r139159
Diffstat (limited to 'gcc/explow.c')
-rw-r--r-- | gcc/explow.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/explow.c b/gcc/explow.c index 0c941d5..a1f7650 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see #include "tree.h" #include "tm_p.h" #include "flags.h" +#include "except.h" #include "function.h" #include "expr.h" #include "optabs.h" @@ -1190,10 +1191,13 @@ allocate_dynamic_stack_space (rtx size, rtx target, int known_align) gcc_assert (!(stack_pointer_delta % (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT))); - /* If needed, check that we have the required amount of stack. Take into - account what has already been checked. */ - if (flag_stack_check && ! STACK_CHECK_BUILTIN) - probe_stack_range (STACK_CHECK_MAX_FRAME_SIZE + STACK_CHECK_PROTECT, size); + /* If needed, check that we have the required amount of stack. + Take into account what has already been checked. */ + if (flag_stack_check == GENERIC_STACK_CHECK) + probe_stack_range (STACK_OLD_CHECK_PROTECT + STACK_CHECK_MAX_FRAME_SIZE, + size); + else if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK) + probe_stack_range (STACK_CHECK_PROTECT, size); /* Don't use a TARGET that isn't a pseudo or is the wrong mode. */ if (target == 0 || !REG_P (target) |