diff options
| author | Nick Clifton <nickc@redhat.com> | 2014-05-19 13:27:25 +0000 | 
|---|---|---|
| committer | Nick Clifton <nickc@gcc.gnu.org> | 2014-05-19 13:27:25 +0000 | 
| commit | 40ba8dfb395e8ed85990a2655cf0d8a0f7619e0c (patch) | |
| tree | d9e926e92becdcc52937f952332b22bbeb3bde5a | |
| parent | cb460086e1601d7ed22a2d911adede51c945c66f (diff) | |
| download | gcc-40ba8dfb395e8ed85990a2655cf0d8a0f7619e0c.zip gcc-40ba8dfb395e8ed85990a2655cf0d8a0f7619e0c.tar.gz gcc-40ba8dfb395e8ed85990a2655cf0d8a0f7619e0c.tar.bz2 | |
except.c (init_eh): Fix computation of builtin setjmp buffer size to allow for targets where...
	* except.c (init_eh): Fix computation of builtin setjmp buffer
	size to allow for targets where POINTER_SIZE > BITS_PER_WORD.
From-SVN: r210612
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/except.c | 17 | 
2 files changed, 20 insertions, 2 deletions
| diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c69a30c..4f48f5d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-05-19  Nick Clifton  <nickc@redhat.com> + +	* except.c (init_eh): Fix computation of builtin setjmp buffer +	size to allow for targets where POINTER_SIZE > BITS_PER_WORD. +  2014-05-19  Richard Biener  <rguenther@suse.de>  	PR tree-optimization/61184 diff --git a/gcc/except.c b/gcc/except.c index 49ebaae..8298593 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -286,9 +286,22 @@ init_eh (void)        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 need room to store at +	 least 3 pointers - stack pointer, frame pointer and return address. +	 Plus for some targets we need room for an extra pointer - in the +	 case of MIPS this is the global pointer.  This makes a total of four +	 pointers, but to be safe we actually allocate room for 5. + +	 If pointers are smaller than words then we allocate enough room for +	 5 words, just in case the backend needs this much room.  For more +	 discussion on this issue see: +	 http://gcc.gnu.org/ml/gcc-patches/2014-05/msg00313.html.  */ +      if (POINTER_SIZE > BITS_PER_WORD) +	tmp = size_int (5 - 1); +      else +	tmp = size_int ((5 * BITS_PER_WORD / POINTER_SIZE) - 1);  #endif +        tmp = build_index_type (tmp);        tmp = build_array_type (ptr_type_node, tmp);        f_jbuf = build_decl (BUILTINS_LOCATION, | 
