From patchwork Tue May 20 17:58:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 350812 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7E6AD14001A for ; Wed, 21 May 2014 04:03:09 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=xOIIpDSVAhEW RII8g2tnjtZOCuxWbL24fApq7/nVz3umCR+IzPwqZXVwNGcpPRoib4NqAbHcGNBy 9i5sjt6ylsu/SIER+etHvQSyz3T+pbcMbN+SBwNUzbe3X1OYr8VT6GXZOUcpsNaG gnWqsziAyopVHJbR0PmXp9A5GRppXTc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; s=default; bh=x6T+YZSdbejSn0yB2r oWX3IdVMk=; b=LHCX9PjNhi/cIFxdBMyAe43siXtZZpvAclfB9vD9Mhs0x3KkEx nOxQK8GryN99M3SM/s7QXoLC2C9KDjKP1ofkpqn49PVwccHgc9m2QvfF8BbNpiMC PvqQB4y2zR92WN4y0TMhCfp8tFzKtG2EAGDKNbiL6f7FqV9cHbeCdEg3A= Received: (qmail 19921 invoked by alias); 20 May 2014 18:03:02 -0000 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 Received: (qmail 19854 invoked by uid 89); 20 May 2014 18:03:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: gcc1-power7.osuosl.org Received: from gcc1-power7.osuosl.org (HELO gcc1-power7.osuosl.org) (140.211.15.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 20 May 2014 18:03:00 +0000 Received: from gcc1-power7.osuosl.org (localhost [127.0.0.1]) by gcc1-power7.osuosl.org (8.14.6/8.14.6) with ESMTP id s4KHxoOr061989; Tue, 20 May 2014 10:59:50 -0700 Received: (from segher@localhost) by gcc1-power7.osuosl.org (8.14.6/8.14.6/Submit) id s4KHxlF1061800; Tue, 20 May 2014 10:59:47 -0700 From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool Subject: [PATCH] dump_case_nodes: Treat unsigned as unsigned, don't ICE Date: Tue, 20 May 2014 10:58:27 -0700 Message-Id: X-IsSubscribed: yes The current code converts every tree to signed hwi; this ICEs with values not representable as shwi, like 9999999999999999999ULL in pr34154.c (and if it didn't ICE, it would print the wrong value). This fixes it. Bootstrapped and tested on powerpc64-linux. Okay to apply? Segher 2014-05-20 Segher Boessenkool gcc/ * stmt.c (dump_case_nodes): Don't convert values to HOST_WIDE_INT before printing. --- gcc/stmt.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/gcc/stmt.c b/gcc/stmt.c index 163d495..722d34f 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -774,24 +774,20 @@ static void dump_case_nodes (FILE *f, struct case_node *root, int indent_step, int indent_level) { - HOST_WIDE_INT low, high; - if (root == 0) return; indent_level++; dump_case_nodes (f, root->left, indent_step, indent_level); - low = tree_to_shwi (root->low); - high = tree_to_shwi (root->high); - fputs (";; ", f); - if (high == low) - fprintf (f, "%*s" HOST_WIDE_INT_PRINT_DEC, - indent_step * indent_level, "", low); - else - fprintf (f, "%*s" HOST_WIDE_INT_PRINT_DEC " ... " HOST_WIDE_INT_PRINT_DEC, - indent_step * indent_level, "", low, high); + fprintf (f, "%*s", indent_step * indent_level, ""); + print_dec (root->low, f, TYPE_SIGN (TREE_TYPE (root->low))); + if (!tree_int_cst_equal (root->low, root->high)) + { + fprintf (f, " ... "); + print_dec (root->high, f, TYPE_SIGN (TREE_TYPE (root->high))); + } fputs ("\n", f); dump_case_nodes (f, root->right, indent_step, indent_level);