aboutsummaryrefslogtreecommitdiff
path: root/gcc/ira.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2009-11-03 22:49:37 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2009-11-03 22:49:37 +0000
commitd809253a56a642cdeb31f3f12e420f092cee0d07 (patch)
treef611e7abf6528b7dc5e27a9acf00f201c85571a7 /gcc/ira.c
parent24d179b4c7717ceeceef16166064bd4a3933cb11 (diff)
downloadgcc-d809253a56a642cdeb31f3f12e420f092cee0d07.zip
gcc-d809253a56a642cdeb31f3f12e420f092cee0d07.tar.gz
gcc-d809253a56a642cdeb31f3f12e420f092cee0d07.tar.bz2
re PR target/10127 (-fstack-check let's program crash)
PR target/10127 PR ada/20548 * expr.h (STACK_CHECK_PROBE_INTERVAL): Delete. (STACK_CHECK_PROBE_INTERVAL_EXP): New macro. (STACK_CHECK_MOVING_SP): Likewise. * system.h (STACK_CHECK_PROBE_INTERVAL): Poison it. * doc/tm.texi (Stack Checking): Delete STACK_CHECK_PROBE_INTERVAL. Document STACK_CHECK_PROBE_INTERVAL_EXP and STACK_CHECK_MOVING_SP. * doc/md.texi (Standard Pattern Names): Tweak entry of CHECK_STACK. Document PROBE_STACK. * explow.c (anti_adjust_stack_and_probe): New function. (allocate_dynamic_stack_space): Do not directly allocate space if STACK_CHECK_MOVING_SP, instead invoke above function. (emit_stack_probe): Handle probe_stack insn. (PROBE_INTERVAL): New macro. (STACK_GROW_OPTAB): Likewise. (STACK_GROW_OFF): Likewise. (probe_stack_range): Use Pmode and memory_address consistently. Fix loop condition in the small constant case. Rewrite in the general case to be immune to wraparounds. Make sure the address of probes is valid. Try to use [base + disp] addressing mode if possible. * ira.c (setup_eliminable_regset): Set frame_pointer_needed if stack checking is enabled and STACK_CHECK_MOVING_SP. * rtlanal.c (may_trap_p_1) <MEM>: If stack checking is enabled, return 1 for volatile references to the stack pointer. * tree.c (build_common_builtin_nodes): Do not set ECF_NOTHROW on __builtin_alloca if stack checking is enabled. * unwind-dw2.c (uw_identify_context): Take into account whether the context is that of a signal frame or not. * config/i386/linux.h (STACK_CHECK_MOVING_SP): Define to 1. * config/i386/linux64.h (STACK_CHECK_MOVING_SP): Likewise. From-SVN: r153877
Diffstat (limited to 'gcc/ira.c')
-rw-r--r--gcc/ira.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/ira.c b/gcc/ira.c
index 962d099..a3e899f 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -1442,6 +1442,9 @@ ira_setup_eliminable_regset (void)
int need_fp
= (! flag_omit_frame_pointer
|| (cfun->calls_alloca && EXIT_IGNORE_STACK)
+ /* We need the frame pointer to catch stack overflow exceptions
+ if the stack pointer is moving. */
+ || (flag_stack_check && STACK_CHECK_MOVING_SP)
|| crtl->accesses_prior_frames
|| crtl->stack_realign_needed
|| targetm.frame_pointer_required ());