From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 960 invoked by alias); 21 Dec 2012 15:54:03 -0000 Received: (qmail 944 invoked by uid 22791); 21 Dec 2012 15:54:01 -0000 X-SWARE-Spam-Status: No, hits=-3.9 required=5.0 tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-wi0-f176.google.com (HELO mail-wi0-f176.google.com) (209.85.212.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 21 Dec 2012 15:53:31 +0000 Received: by mail-wi0-f176.google.com with SMTP id hm6so5151302wib.9 for ; Fri, 21 Dec 2012 07:53:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.24.133 with SMTP id u5mr15957353wif.17.1356105209923; Fri, 21 Dec 2012 07:53:29 -0800 (PST) Received: by 10.216.153.132 with HTTP; Fri, 21 Dec 2012 07:53:29 -0800 (PST) In-Reply-To: References: <50D42823.9030601@oracle.com> <50D42CAB.4090704@oracle.com> <50D42E31.30807@oracle.com> Date: Fri, 21 Dec 2012 15:54:00 -0000 Message-ID: Subject: Re: [patch libstdc++]: Fix LLP64 pointer-size issues for cxxabi, eh_alloc, and hash_bytes From: Kai Tietz To: Gabriel Dos Reis Cc: Paolo Carlini , GCC Patches , "libstdc++" Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-12/txt/msg01323.txt.bz2 2012/12/21 Gabriel Dos Reis : > On Fri, Dec 21, 2012 at 3:48 AM, Kai Tietz wrote: >> 2012/12/21 Paolo Carlini : >>> On 12/21/2012 10:36 AM, Kai Tietz wrote: >>>> >>>> well, issue isn't that 'long' is always 'ptrdiff_t'. >>> >>> But then, if we just change the type without paying attention to size (and >>> alignment) aren't we looking for BIG ABI trouble?!? >> >> Huh? We have ABI-trouble due long is too small to hold a >> pointer-diff for llp64. Intended is here 'pointer-size' AFAICS in >> code, but with wrong assumption that a 'long' is always long enough. >> >> Btw I just checked all targets we have right now in gcc. The type >> ptrdiff_t is always either 'long', or 'int' (ilp32, lp64), and 'long >> long' for LLP64. Means ptrdiff_t gets always equal (or bigger) to >> biggest pointer-size for target (AFAICS). >> >> Kai > > We must write the codes so that their intents are clear, without > requiring lot of reverse engineering every time one looks at them. If we > intend offset, then clearly ptrdiff_t is the first choice. Solid > reasons must be provided why it can't be ptrdiff_t and such > reasons must be part of the code as comments explaining why > the obvious thing should be discounted. > > - Gaby Agreed that we are using at some place too complex logic to avoid standard-types we already have ... We need to modify for cxxabi.h header-change also cp/rtti.c, as here the 'long' type-assumption is done, too. instead of using integer_type[itk_long/itk_long_long] there we then have to use instead ptrdiff_type_node. And this is for some targets a possible ABI-change due type_info-record might change size ... for 4.9 this change looks suitable to me, but for 4.8 we should simply check for now for itk_long/itk_long_long here (as done by other patch I've sent). Kai