OSDN Git Service

* doc/tm.texi (STACK_CHECK_PROTECT): Document alternate default.
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Dec 2009 10:12:43 +0000 (10:12 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Dec 2009 10:12:43 +0000 (10:12 +0000)
* doc/md.texi (check_stack): Clarify.
(probe_stack): Likewise.
* config/rs6000/rs6000.md (UNSPEC_PROBE_STACK): New constant.
(probe_stack): New insn.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155209 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/rs6000/rs6000.md
gcc/doc/md.texi
gcc/doc/tm.texi

index 7e97556..207095c 100644 (file)
@@ -1,3 +1,11 @@
+2009-12-14  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * doc/tm.texi (STACK_CHECK_PROTECT): Document alternate default.
+       * doc/md.texi (check_stack): Clarify.
+       (probe_stack): Likewise.
+       * config/rs6000/rs6000.md (UNSPEC_PROBE_STACK): New constant.
+       (probe_stack): New insn.
+
 2009-12-14  Ben Elliston  <bje@au.ibm.com>
 
        * lto-streamer-in.c (lto_get_builtin_tree): fclass can only be a
index 5b69f70..5e959db 100644 (file)
@@ -55,6 +55,7 @@
 
 (define_constants
   [(UNSPEC_FRSP                        0)      ; frsp for POWER machines
+   (UNSPEC_PROBE_STACK         4)      ; probe stack memory reference
    (UNSPEC_TIE                 5)      ; tie stack contents and stack pointer
    (UNSPEC_TOCPTR              6)      ; address of a word pointing to the TOC
    (UNSPEC_TOC                 7)      ; address of the TOC (more-or-less)
   [(unspec_volatile [(const_int 0)] UNSPECV_BLOCK)]
   ""
   "")
+
+(define_insn "probe_stack"
+  [(unspec [(match_operand 0 "memory_operand" "=m")] UNSPEC_PROBE_STACK)]
+  ""
+  "{st%U0%X0|stw%U0%X0} 0,%0"
+  [(set_attr "type" "store")
+   (set_attr "length" "4")])
 \f
 ;; Compare insns are next.  Note that the RS/6000 has two types of compares,
 ;; signed & unsigned, and one type of branch.
index 2974dcf..5a92a80 100644 (file)
@@ -5035,21 +5035,20 @@ operations in addition to updating the stack pointer.
 
 @cindex @code{check_stack} instruction pattern
 @item @samp{check_stack}
-If stack checking cannot be done on your system by probing the stack with
-a load or store instruction (@pxref{Stack Checking}), define this pattern
-to perform the needed check and signal an error if the stack has overflowed.
-The single operand is the address in the stack furthest from the current
-stack pointer that you need to validate.  Normally, on machines where this
-pattern is needed, you would obtain the stack limit from a global or
-thread-specific variable or register.
+If stack checking (@pxref{Stack Checking}) cannot be done on your system by
+probing the stack, define this pattern to perform the needed check and signal
+an error if the stack has overflowed.  The single operand is the address in
+the stack farthest from the current stack pointer that you need to validate.
+Normally, on platforms where this pattern is needed, you would obtain the
+stack limit from a global or thread-specific variable or register.
 
 @cindex @code{probe_stack} instruction pattern
 @item @samp{probe_stack}
-If stack checking can be done on your system by probing the stack but doing
-it with a load or store instruction is not optimal (@pxref{Stack Checking}),
-define this pattern to do the probing differently and signal an error if
-the stack has overflowed.  The single operand is the memory location in the
-stack that needs to be probed.
+If stack checking (@pxref{Stack Checking}) can be done on your system by
+probing the stack but doing it with a ``store zero'' instruction is not valid
+or optimal, define this pattern to do the probing differently and signal an
+error if the stack has overflowed.  The single operand is the memory reference
+in the stack that needs to be probed.
 
 @cindex @code{nonlocal_goto} instruction pattern
 @item @samp{nonlocal_goto}
index 9a9d493..6a29917 100644 (file)
@@ -3574,9 +3574,11 @@ default value of this macro is zero.
 @end defmac
 
 @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 should be adequate for most machines.
+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
+with the @code{setjmp}/@code{longjmp}-based exception handling mechanism and
+8192 bytes with other exception handling mechanisms should be adequate for
+most machines.
 @end defmac
 
 The following macros are relevant only if neither STACK_CHECK_BUILTIN