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
===================================================================
--- gcc/except.c        (revision 180758)
+++ gcc/except.c        (working copy)
@@ -253,13 +253,13 @@ init_eh (void)
         also tend to be larger than necessary for most systems, a more
         optimal port will define JMP_BUF_SIZE.  */
       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);
+      tmp = size_int (5 * POINTER_SIZE / BITS_PER_WORD - 1);
 #endif
       tmp = build_index_type (tmp);
       tmp = build_array_type (ptr_type_node, tmp);
       f_jbuf = build_decl (BUILTINS_LOCATION,
                           FIELD_DECL, get_identifier ("__jbuf"), tmp);
 #ifdef DONT_USE_BUILTIN_SETJMP

Reply via email to