From patchwork Thu Sep 3 12:42:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 514044 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 891C6140273 for ; Thu, 3 Sep 2015 22:42:26 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=XaKQwYdt; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=KnnY6Oz1CKrThQ/+KGiOBlNcxbdUmL8t5de2wULvIJCEHdLfja1O3 ZHP/wGp95BDMO5+S1XxIDEkJikV42LfKH73ykmSI7ic6KA1HCFSLz/+NpG8CHnw5 lNpwCGd8AzUuDG3wwYmoM3XJ3f2Qb+tu6qhuSJsFeXC7kyqtdtoyDE= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=2Qm5N4BHlYi22t2EQD4e+PgvykM=; b=XaKQwYdtOmJoWwvFkx+P jXoYydnR+7Obd0A5h+hmLPwxW8OAUcRcRfXtcR/jSKkJ6vMIVUtLPZckYvS4XfJ8 OHSq+dE0LK2zWgdk6y5jpsb5JC8la1v6rqMsla/NDvb7Blrc3mVV69n2wJH8DvQU K0VfU3uA4ZUrvgZwBHSGSug= 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-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 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, 3 Sep 2015 14:42:14 +0200 (CEST) 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 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); }