From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5873 invoked by alias); 29 Nov 2012 12:45:59 -0000 Received: (qmail 5863 invoked by uid 22791); 29 Nov 2012 12:45:58 -0000 X-SWARE-Spam-Status: No, hits=-4.3 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-wg0-f51.google.com (HELO mail-wg0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Nov 2012 12:45:54 +0000 Received: by mail-wg0-f51.google.com with SMTP id ei8so5361537wgb.8 for ; Thu, 29 Nov 2012 04:45:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.74.108 with SMTP id s12mr34939238wiv.12.1354193153271; Thu, 29 Nov 2012 04:45:53 -0800 (PST) Received: by 10.216.153.132 with HTTP; Thu, 29 Nov 2012 04:45:53 -0800 (PST) In-Reply-To: <50B753FE.10809@redhat.com> References: <50B753FE.10809@redhat.com> Date: Thu, 29 Nov 2012 12:45:00 -0000 Message-ID: Subject: Re: [patch c++]: 1 of 7 Fix for PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32 From: Kai Tietz To: Pedro Alves Cc: GCC Patches , Jason Merrill 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-11/txt/msg02422.txt.bz2 2012/11/29 Pedro Alves : > On 11/29/2012 12:03 PM, Kai Tietz wrote: >> Hello, >> >> this trivial patch fixes a bootstrap issue on LLP64 hosts. > > But it's trivial at the expense of truncating the pointer. > Looking around, I'd think that something like casting to hwi (after uintptr_t), > and then use HOST_WIDE_INT_PRINT_HEX as format would be the gcc way. > >> Index: cp/class.c >> =================================================================== >> --- cp/class.c (Revision 193925) >> +++ cp/class.c (Arbeitskopie) >> @@ -7817,7 +7817,7 @@ dump_class_hierarchy_r (FILE *stream, >> indented = maybe_indent_hierarchy (stream, indent, 0); >> fprintf (stream, "%s (0x%lx) ", >> type_as_string (BINFO_TYPE (binfo), TFF_PLAIN_IDENTIFIER), >> - (unsigned long) binfo); >> + (unsigned long) (uintptr_t) binfo); > > -- > Pedro Alves Well, hwi format is of course the way to display pointer complete. On the other hand are in most cases lower 32-bit sufficent on debug-output. Kai