From patchwork Fri Jun 12 01:28:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 483347 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 5A36E140273 for ; Fri, 12 Jun 2015 11:29:03 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=aQDOl0tc; 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 :message-id:from:to:subject; q=dns; s=default; b=iwlIVOPV84bFCbt czRTXZu5oJ3pzHNXEQ111F9V0+0whzIZvkf9Y92ql1xJ7OqqCq0g4vTdzXT0A+ml 3QAPeQZjxLZO+u5BJMriMuInlqc9H49kUC3B3Ob2vlmv+55l63rcfdaMqt6VXa9I o64hkCYRtw7hNl52hAILUenFT0Uw= 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 :message-id:from:to:subject; s=default; bh=ludZtz/OdXUMBH2Gjcy3e 2893nE=; b=aQDOl0tcMz7fiPNi5f8weFgJnDJTpb6X4VCC9R0ho/SPIBVaapxBZ TBb66mz63VDr1Z/IiGyfsNoaq0i+pLoP4u0CVLwNe+2wfYAGcK7XP7PoRyzsPc59 h1W6mQhVqCwCIvSsA8zqkeLQURDzKtQPVnnCkLT6j+bNzjPh/TYSnY= Received: (qmail 56517 invoked by alias); 12 Jun 2015 01:28:56 -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 56501 invoked by uid 89); 12 Jun 2015 01:28:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_05, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 12 Jun 2015 01:28:54 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 20B113635C6 for ; Fri, 12 Jun 2015 01:28:53 +0000 (UTC) Received: from greed.delorie.com (ovpn-113-25.phx2.redhat.com [10.3.113.25]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5C1SqkH003556 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Jun 2015 21:28:52 -0400 Received: from greed.delorie.com (greed.delorie.com [127.0.0.1]) by greed.delorie.com (8.14.4/8.14.4) with ESMTP id t5C1SpbB006910; Thu, 11 Jun 2015 21:28:51 -0400 Received: (from dj@localhost) by greed.delorie.com (8.14.4/8.14.4/Submit) id t5C1SpwU006908; Thu, 11 Jun 2015 21:28:51 -0400 Date: Thu, 11 Jun 2015 21:28:51 -0400 Message-Id: <201506120128.t5C1SpwU006908@greed.delorie.com> From: DJ Delorie To: gcc-patches@gcc.gnu.org Subject: [lto] intN follow-up patch X-IsSubscribed: yes This was missed in the big intN patch set I did last year; it only shows up if you have a target with an N-bit type that isn't also used for a pointer type but is used for unwinding (which is a change I also have pending, hence I noticed ;). Tested on x86-64 and msp430 (with the pending patch) with no regressions. Ok? * lto-lang.c (lto_type_for_size): Include intN types. (lto_type_for_mode): Likewise. Index: gcc/lto/lto-lang.c =================================================================== --- gcc/lto/lto-lang.c (revision 224364) +++ gcc/lto/lto-lang.c (working copy) @@ -827,12 +827,14 @@ lto_post_options (const char **pfilename /* Return an integer type with PRECISION bits of precision, that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */ static tree lto_type_for_size (unsigned precision, int unsignedp) { + int i; + if (precision == TYPE_PRECISION (integer_type_node)) return unsignedp ? unsigned_type_node : integer_type_node; if (precision == TYPE_PRECISION (signed_char_type_node)) return unsignedp ? unsigned_char_type_node : signed_char_type_node; @@ -844,12 +846,18 @@ lto_type_for_size (unsigned precision, i if (precision == TYPE_PRECISION (long_long_integer_type_node)) return unsignedp ? long_long_unsigned_type_node : long_long_integer_type_node; + for (i = 0; i < NUM_INT_N_ENTS; i ++) + if (int_n_enabled_p[i] + && precision == int_n_data[i].bitsize) + return (unsignedp ? int_n_trees[i].unsigned_type + : int_n_trees[i].signed_type); + if (precision <= TYPE_PRECISION (intQI_type_node)) return unsignedp ? unsigned_intQI_type_node : intQI_type_node; if (precision <= TYPE_PRECISION (intHI_type_node)) return unsignedp ? unsigned_intHI_type_node : intHI_type_node; @@ -873,12 +881,13 @@ lto_type_for_size (unsigned precision, i then UNSIGNEDP selects between saturating and nonsaturating types. */ static tree lto_type_for_mode (machine_mode mode, int unsigned_p) { tree t; + int i; if (mode == TYPE_MODE (integer_type_node)) return unsigned_p ? unsigned_type_node : integer_type_node; if (mode == TYPE_MODE (signed_char_type_node)) return unsigned_p ? unsigned_char_type_node : signed_char_type_node; @@ -889,12 +898,18 @@ lto_type_for_mode (machine_mode mode, in if (mode == TYPE_MODE (long_integer_type_node)) return unsigned_p ? long_unsigned_type_node : long_integer_type_node; if (mode == TYPE_MODE (long_long_integer_type_node)) return unsigned_p ? long_long_unsigned_type_node : long_long_integer_type_node; + for (i = 0; i < NUM_INT_N_ENTS; i ++) + if (int_n_enabled_p[i] + && mode == int_n_data[i].m) + return (unsigned_p ? int_n_trees[i].unsigned_type + : int_n_trees[i].signed_type); + if (mode == QImode) return unsigned_p ? unsigned_intQI_type_node : intQI_type_node; if (mode == HImode) return unsigned_p ? unsigned_intHI_type_node : intHI_type_node;