From patchwork Thu Nov 3 03:30:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 123390 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id C7ABDB6F7D for ; Thu, 3 Nov 2011 14:30:46 +1100 (EST) Received: (qmail 6966 invoked by alias); 3 Nov 2011 03:30:44 -0000 Received: (qmail 6958 invoked by uid 22791); 3 Nov 2011 03:30:44 -0000 X-SWARE-Spam-Status: No, hits=-5.6 required=5.0 tests=AWL, BAYES_50, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SPF_HELO_PASS, TW_JB, TW_TJ X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Nov 2011 03:30:31 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pA33UUmU015429 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 2 Nov 2011 23:30:31 -0400 Received: from greed.delorie.com ([10.3.113.14]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pA33UUad022857 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 2 Nov 2011 23:30:30 -0400 Received: from greed.delorie.com (greed.delorie.com [127.0.0.1]) by greed.delorie.com (8.14.4/8.14.4) with ESMTP id pA33UT7x029598 for ; Wed, 2 Nov 2011 23:30:29 -0400 Received: (from dj@localhost) by greed.delorie.com (8.14.4/8.14.4/Submit) id pA33USdS029597; Wed, 2 Nov 2011 23:30:29 -0400 Date: Wed, 2 Nov 2011 23:30:29 -0400 Message-Id: <201111030330.pA33USdS029597@greed.delorie.com> From: DJ Delorie To: gcc-patches@gcc.gnu.org Subject: except.c: fix setjmp buffer size math X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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