From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119224 invoked by alias); 3 Sep 2015 12:42:19 -0000 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 Received: (qmail 119192 invoked by uid 89); 3 Sep 2015 12:42:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,KAM_ASCII_DIVIDERS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 03 Sep 2015 12:42:17 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8830AAD93 for ; Thu, 3 Sep 2015 12:42:14 +0000 (UTC) Date: Thu, 03 Sep 2015 13:18:00 -0000 From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Side-step wide_int_to_tree issue Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2015-09/txt/msg00253.txt.bz2 In this particular place which otherwise triggers with Index: gcc/tree.c =================================================================== --- gcc/tree.c (revision 227429) +++ gcc/tree.c (working copy) @@ -1395,6 +1395,8 @@ wide_int_to_tree (tree type, const wide_ gcc_checking_assert (pcst.elt (l - 2) >= 0); } + gcc_assert (prec <= pcst.get_precision ()); + wide_int cst = wide_int::from (pcst, prec, sgn); unsigned int ext_len = get_int_cst_ext_nunits (type, cst); Bootstrapped / tested on x86_64-unknown-linux-gnu, applied. Richard. 2015-09-03 Richard Biener * varasm.c (output_constant): Use fold_convert instead of wide_int_to_tree. Index: gcc/varasm.c =================================================================== --- gcc/varasm.c (revision 227429) +++ gcc/varasm.c (working copy) @@ -4699,7 +4699,7 @@ output_constant (tree exp, unsigned HOST exp = build1 (ADDR_EXPR, saved_type, TREE_OPERAND (exp, 0)); /* Likewise for constant ints. */ else if (TREE_CODE (exp) == INTEGER_CST) - exp = wide_int_to_tree (saved_type, exp); + exp = fold_convert (saved_type, exp); }