Re: except.c: fix setjmp buffer size math

2011-11-03 Thread Joseph S. Myers
On Thu, 3 Nov 2011, Mike Stump wrote: > On Nov 3, 2011, at 2:14 AM, Eric Botcazou wrote: > > >>* except.c (init_eh): Fix setjmp buffer size calculations for > >>targets where pointers are not word-sized. > > > > This will shrink the buffer for most such targets though. > > I prefer: >

Re: except.c: fix setjmp buffer size math

2011-11-03 Thread Eric Botcazou
> If the comment is true, and it takes a pointer to five WORDS, why are > we using POINTER_SIZE at all? Because of the 2 lines just below: tmp = build_index_type (tmp); tmp = build_array_type (ptr_type_node, tmp); > Does it actually take a pointer to five POINTERS? No. > If so, w

Re: except.c: fix setjmp buffer size math

2011-11-03 Thread Eric Botcazou
> I prefer: > > #ifndef TARGET_BUILTIN_JMP_BUF_SIZE > #define TARGET_BUILTIN_JMP_BUF_SIZE 5 > #endif > /* builtin_setjmp takes a pointer to TARGET_BUILTIN_JMP_BUF_SIZE > words. */ tmp = build_int_cst (NULL_TREE, TARGET_BUILTIN_JMP_BUF_SIZE * > BITS_PER_WORD / POINTER_SIZE - 1); > > This does

Re: except.c: fix setjmp buffer size math

2011-11-03 Thread DJ Delorie
If the comment is true, and it takes a pointer to five WORDS, why are we using POINTER_SIZE at all? Does it actually take a pointer to five POINTERS? If so, where did the '4' come from? >/* builtin_setjmp takes a pointer to 5 words. */ > - tmp = size_int (5 * BITS_PER_WORD / POINT

Re: except.c: fix setjmp buffer size math

2011-11-03 Thread Mike Stump
On Nov 3, 2011, at 2:14 AM, Eric Botcazou wrote: >> * except.c (init_eh): Fix setjmp buffer size calculations for >> targets where pointers are not word-sized. > > This will shrink the buffer for most such targets though. I prefer: #ifndef TARGET_BUILTIN_JMP_BUF_SIZE #define TARGET_BU

Re: except.c: fix setjmp buffer size math

2011-11-03 Thread Eric Botcazou
> * except.c (init_eh): Fix setjmp buffer size calculations for > targets where pointers are not word-sized. This will shrink the buffer for most such targets though. > Index: gcc/except.c > === > --- gcc/except.c (r

except.c: fix setjmp buffer size math

2011-11-02 Thread DJ Delorie
The RL78 port has 8 bit registers and 16 bit pointers. The existing calculation resulted in a buffer that was too small for the five values needed. * except.c (init_eh): Fix setjmp buffer size calculations for targets where pointers are not word-sized. Index: gcc/except.c ==