summaryrefslogtreecommitdiff
path: root/gcc/expr.h
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-03 22:49:37 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-03 22:49:37 +0000
commit42982f3eb81ef5937a47218569aa656164633a1a (patch)
treef611e7abf6528b7dc5e27a9acf00f201c85571a7 /gcc/expr.h
parent3c2a960db94231a479790e7a9681a051ad8800a7 (diff)
downloadgcc-42982f3eb81ef5937a47218569aa656164633a1a.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153877 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.h')
-rw-r--r--gcc/expr.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/gcc/expr.h b/gcc/expr.h
index 0eceb6e45be..e84779639b5 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -218,9 +218,9 @@ do { \
#define STACK_CHECK_STATIC_BUILTIN 0
#endif
-/* The default interval is one page. */
-#ifndef STACK_CHECK_PROBE_INTERVAL
-#define STACK_CHECK_PROBE_INTERVAL 4096
+/* The default interval is one page (4096 bytes). */
+#ifndef STACK_CHECK_PROBE_INTERVAL_EXP
+#define STACK_CHECK_PROBE_INTERVAL_EXP 12
#endif
/* The default is to do a store into the stack. */
@@ -228,6 +228,11 @@ do { \
#define STACK_CHECK_PROBE_LOAD 0
#endif
+/* The default is not to move the stack pointer. */
+#ifndef STACK_CHECK_MOVING_SP
+#define STACK_CHECK_MOVING_SP 0
+#endif
+
/* This is a kludge to try to capture the discrepancy between the old
mechanism (generic stack checking) and the new mechanism (static
builtin stack checking). STACK_CHECK_PROTECT needs to be bumped
@@ -252,7 +257,7 @@ do { \
one probe per function. */
#ifndef STACK_CHECK_MAX_FRAME_SIZE
#define STACK_CHECK_MAX_FRAME_SIZE \
- (STACK_CHECK_PROBE_INTERVAL - UNITS_PER_WORD)
+ ((1 << STACK_CHECK_PROBE_INTERVAL_EXP) - UNITS_PER_WORD)
#endif
/* This is arbitrary, but should be large enough everywhere. */
@@ -779,10 +784,9 @@ extern void update_nonlocal_goto_save_area (void);
extern rtx allocate_dynamic_stack_space (rtx, rtx, int);
/* Probe a range of stack addresses from FIRST to FIRST+SIZE, inclusive.
- FIRST is a constant and size is a Pmode RTX. These are offsets from the
- current stack pointer. STACK_GROWS_DOWNWARD says whether to add or
- subtract from the stack. If SIZE is constant, this is done
- with a fixed number of probes. Otherwise, we must make a loop. */
+ FIRST is a constant and size is a Pmode RTX. These are offsets from
+ the current stack pointer. STACK_GROWS_DOWNWARD says whether to add
+ or subtract them from the stack pointer. */
extern void probe_stack_range (HOST_WIDE_INT, rtx);
/* Return an rtx that refers to the value returned by a library call