Index: gcc/builtins.c
===================================================================
--- gcc/builtins.c	(revision 210412)
+++ gcc/builtins.c	(working copy)
@@ -984,10 +984,10 @@
   emit_insn (gen_blockage ());
 }
 
-/* __builtin_longjmp is passed a pointer to an array of five words (not
-   all will be used on all machines).  It operates similarly to the C
-   library function of the same name, but is more efficient.  Much of
-   the code below is copied from the handling of non-local gotos.  */
+/* __builtin_longjmp is passed a pointer to an array of ~4 pointer sized
+   entries, not all will be used on all machines.  It operates similarly
+   to the C library function of the same name, but is more efficient.  Much
+   of the code below is copied from the handling of non-local gotos.  */
 
 static void
 expand_builtin_longjmp (rtx buf_addr, rtx value)
@@ -1211,10 +1211,10 @@
   return const0_rtx;
 }
 
-/* __builtin_update_setjmp_buf is passed a pointer to an array of five words
-   (not all will be used on all machines) that was passed to __builtin_setjmp.
-   It updates the stack pointer in that block to correspond to the current
-   stack pointer.  */
+/* __builtin_update_setjmp_buf is passed a pointer to an array of ~4 
+   entries (not all will be used on all machines) that was passed to
+   __builtin_setjmp.  It updates the stack pointer in that block to
+   correspond to the current stack pointer.  */
 
 static void
 expand_builtin_update_setjmp_buf (rtx buf_addr)
@@ -6211,8 +6211,8 @@
       gcc_unreachable ();
 
     case BUILT_IN_SETJMP_SETUP:
-      /* __builtin_setjmp_setup is passed a pointer to an array of five words
-          and the receiver label.  */
+      /* __builtin_setjmp_setup is passed a pointer to an array of ~4
+	 entries and the receiver label.  */
       if (validate_arglist (exp, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
 	{
 	  rtx buf_addr = expand_expr (CALL_EXPR_ARG (exp, 0), subtarget,
@@ -6245,9 +6245,9 @@
 	}
       break;
 
-      /* __builtin_longjmp is passed a pointer to an array of five words.
-	 It's similar to the C library longjmp function but works with
-	 __builtin_setjmp above.  */
+      /* __builtin_longjmp is passed a pointer to an array of ~4
+	 entries.  It's similar to the C library longjmp function
+	 but works with __builtin_setjmp above.  */
     case BUILT_IN_LONGJMP:
       if (validate_arglist (exp, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE))
 	{
Index: gcc/doc/md.texi
===================================================================
--- gcc/doc/md.texi	(revision 210412)
+++ gcc/doc/md.texi	(working copy)
@@ -6112,10 +6112,15 @@
 A typical reason why you might need this pattern is if some value, such
 as a pointer to a global table, must be restored.  Though it is
 preferred that the pointer value be recalculated if possible (given the
-address of a label for instance).  The single argument is a pointer to
-the @code{jmp_buf}.  Note that the buffer is five words long and that
-the first three are normally used by the generic mechanism.
+address of a label for instance).
 
+The single argument is a pointer to the @code{jmp_buf}.  This buffer
+is big enough to hold approximately 4 @code{Pmode} sized entries,
+although the exact size is target dependent.  The generic mechanism
+uses three entries, (to hold the frame pointer, return address and
+stack pointer respectively), but this pattern can make use of the
+extra space if it so desires.
+
 @cindex @code{builtin_setjmp_receiver} instruction pattern
 @item @samp{builtin_setjmp_receiver}
 This pattern, if defined, contains code needed at the site of a
Index: gcc/except.c
===================================================================
--- gcc/except.c	(revision 210412)
+++ gcc/except.c	(working copy)
@@ -286,8 +286,16 @@
       tmp = size_int (FIRST_PSEUDO_REGISTER + 2 - 1);
 #endif
 #else
-      /* builtin_setjmp takes a pointer to 5 words.  */
-      tmp = size_int (5 * BITS_PER_WORD / POINTER_SIZE - 1);
+      /* Compute a minimally sized jump buffer.  We are going to store 2
+	 pointers in it (frame pointer and return address), plus whatever is
+	 needed by emit_stack_save(SAVE_NONLOCAL).  Plus for the MIPS we need
+	 room to save the global pointer.  For more discussion on this topic
+	 see: http://gcc.gnu.org/ml/gcc-patches/2014-05/msg00313.html.  */
+      tmp = size_int (MAX (GET_MODE_SIZE (STACK_SAVEAREA_MODE (SAVE_NONLOCAL))
+			   / GET_MODE_SIZE (Pmode), 1)
+		      + 2 /* Stack pointer and frame pointer.  */
+		      + 1 /* Slop for mips.  */
+		      - 1);
 #endif
       tmp = build_index_type (tmp);
       tmp = build_array_type (ptr_type_node, tmp);
