From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8391 invoked by alias); 2 Sep 2011 13:50:16 -0000 Received: (qmail 8379 invoked by uid 22791); 2 Sep 2011 13:50:14 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Sep 2011 13:49:58 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 4AD7D8ADF6 for ; Fri, 2 Sep 2011 15:49:57 +0200 (CEST) Date: Fri, 02 Sep 2011 13:50:00 -0000 From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Print unsigned host-wide-int fitting INTEGER_CSTs regularly Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: 2011-09/txt/msg00161.txt.bz2 without resorting to hex printing of both high/low values. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. Richard. 2011-09-02 Richard Guenther * pretty-print.h (pp_unsigned_wide_integer): New. * tree-pretty-print.c (dump_generic_node): Print unsigned host-wide-int fitting INTEGER_CSTs with pp_unsigned_wide_integer. Index: gcc/pretty-print.h =================================================================== --- gcc/pretty-print.h (revision 178465) +++ gcc/pretty-print.h (working copy) @@ -276,6 +276,8 @@ struct pretty_print_info } \ while (0) #define pp_decimal_int(PP, I) pp_scalar (PP, "%d", I) +#define pp_unsigned_wide_integer(PP, I) \ + pp_scalar (PP, HOST_WIDE_INT_PRINT_UNSIGNED, (unsigned HOST_WIDE_INT) I) #define pp_wide_integer(PP, I) \ pp_scalar (PP, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT) I) #define pp_widest_integer(PP, I) \ Index: gcc/tree-pretty-print.c =================================================================== --- gcc/tree-pretty-print.c (revision 178465) +++ gcc/tree-pretty-print.c (working copy) @@ -1002,7 +1002,11 @@ dump_generic_node (pretty_printer *buffe pp_wide_integer (buffer, TREE_INT_CST_LOW (node)); pp_string (buffer, "B"); /* pseudo-unit */ } - else if (! host_integerp (node, 0)) + else if (host_integerp (node, 0)) + pp_wide_integer (buffer, TREE_INT_CST_LOW (node)); + else if (host_integerp (node, 1)) + pp_unsigned_wide_integer (buffer, TREE_INT_CST_LOW (node)); + else { tree val = node; unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (val); @@ -1021,8 +1025,6 @@ dump_generic_node (pretty_printer *buffe (unsigned HOST_WIDE_INT) high, low); pp_string (buffer, pp_buffer (buffer)->digit_buffer); } - else - pp_wide_integer (buffer, TREE_INT_CST_LOW (node)); break; case REAL_CST: