Message ID | 87k23cn31w.fsf@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1924444qge; Thu, 13 Jul 2017 01:40:06 -0700 (PDT) X-Received: by 10.84.130.76 with SMTP id 70mr8752243plc.138.1499935206149; Thu, 13 Jul 2017 01:40:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499935206; cv=none; d=google.com; s=arc-20160816; b=B5J5q89r+68hb/yiGj6OqmqGWTwRghtyMOoVAPGpQfGhxL8/Grp981z0ld/ZwYFhM1 dDbEr0X1u735xEY/EvacWLTG84v8kfS0j6h2vaKJyG43PunD39QvPgcsDSwYTldlKS6Z 3GX58Ig7QO/CPPYumOB7NyoYDmQY3+YOJ9eGWFopQrS+XzxJx2chZg/1Rat6Ma4X2xA3 2gOiNnKWwkyk3auLqCMSH79DKdY/VayYeEsM66l+AYxZElJWxxoJI6sw+mJthzkvJzzR DKg5hXA5QUO3wFD+Uk82Nh5z/loVgvP9AXRytsl5y9hCbGT2c0pS5AxpYlpyPs3LKYG6 uFFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:mail-followup-to:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=z4H15vHlVbbi2ls6tjlDmCNkKbiZrGq+N05CDDAn9mE=; b=yOuInONJJEOTBY5pyxsXn1umeLobRtAMvIrCN/iDVrTXmF+WRYAmtABoAQr7Y5Qcg3 lxu18aAu/C+2ynfS/ask6uOiPOgzeYBf6zukiiQ4VUnmRgKJ2orBXWqEVeAdhItuxJlN utxHP8cj5pqn0EYmJHZdjmqdZRUTooIVtkfRRepIliKBCbtY9Pz2+0vqta4yn+zHmBTb mtDTVAJlM95EjaPu6ZTF3cOH8hNZm9A4qayC1Um4Al79+3fn4RkCqOpCGsmb03rO+xIp UC/0FjaZdS6NIQnRLDzB70mP+6OqL6DroKcToYMjrboNYMCketwNPNXD8CJhrCOIjMMu EkwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.b=fAs66004; spf=pass (google.com: domain of gcc-patches-return-457995-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-457995-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <gcc-patches-return-457995-patch=linaro.org@gcc.gnu.org> Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id u6si4126981pld.97.2017.07.13.01.40.05 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jul 2017 01:40:06 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-457995-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.b=fAs66004; spf=pass (google.com: domain of gcc-patches-return-457995-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-457995-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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:subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=default; b=aAwJq+I6QgGYiRfzssguqt4kjNtxU BH4UVj5YV4Has8T0OveQnMf3XqWCfVtNbFS2/+t3GQQYKEBgVuYU5y96adnLJVZU 2DzDQ1luph8eAnxQT+DqZeUWDsgD1JyuXlerGsngxcB5LVdh3/1UM7OZDumF8zGJ CUDTrjPHtw1TU4= 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:subject:references:date:in-reply-to:message-id:mime-version :content-type; s=default; bh=zXyavFCDq7u53bh/hTvuD+0J2Ks=; b=fAs 660048LCnQq2tvg/v5Dk/pOsA88fQ9lUFxA2e5ZGwh6o5ifvhX1GJmuom4NZXvaU CA+7d7wanrYNlTXHmwEciVfbWJPpK/rgPFh8vUWVON3yo5yQB3XT8CUjjBvzTm8h Qgz/yCcQpRvwut0HqgIwq7n18bMsV8Jjji4iGWfM= Received: (qmail 121196 invoked by alias); 13 Jul 2017 08:39:47 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: <gcc-patches.gcc.gnu.org> List-Unsubscribe: <mailto:gcc-patches-unsubscribe-patch=linaro.org@gcc.gnu.org> List-Archive: <http://gcc.gnu.org/ml/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-help@gcc.gnu.org> Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 120826 invoked by uid 89); 13 Jul 2017 08:39:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=10877 X-HELO: mail-wr0-f181.google.com Received: from mail-wr0-f181.google.com (HELO mail-wr0-f181.google.com) (209.85.128.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Jul 2017 08:39:44 +0000 Received: by mail-wr0-f181.google.com with SMTP id r103so49397640wrb.0 for <gcc-patches@gcc.gnu.org>; Thu, 13 Jul 2017 01:39:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=z4H15vHlVbbi2ls6tjlDmCNkKbiZrGq+N05CDDAn9mE=; b=ZgoC0u4shNiz1YjZoOMz6asLU8nmU0XuTjMAuggyFKWwxCdo09bEn0KUQ7FK7Kbe0N XPfTwuFi5YUNEO2iWdSdL7YT3BV4w6q+dSOhy8eBdC3fSNfFYuDCSsMmjlFHshFqwJ2e sNT0jW7eOd/1vdevad7mx65ajQl9KjS6f/oxGeLikeB7Usevl3aC21IroxpsA1Lqom+y ZiEpzGbkSwH1nxnl1f26Q5DMuAaWeAeqg++DWUUvDwlzSkhqbNoCx28DLqc2TPZRbykG U5asDDuFZFDT4SE9MaHms12xWh+JAVQTXwKrwP0OmHU+fuYHTxz157uyyqQtlGFLWrFZ +CvQ== X-Gm-Message-State: AIVw113bgxRhyO48wg+Oe2bQVosfbw5N2p/ECENSN1J6bX7cFqea5a00 BK6BhM1bft6KoRxv0jqiew== X-Received: by 10.223.145.227 with SMTP id 90mr824460wri.171.1499935182097; Thu, 13 Jul 2017 01:39:42 -0700 (PDT) Received: from localhost (92.40.249.184.threembb.co.uk. [92.40.249.184]) by smtp.gmail.com with ESMTPSA id 32sm5610185wry.31.2017.07.13.01.39.41 for <gcc-patches@gcc.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jul 2017 01:39:41 -0700 (PDT) From: Richard Sandiford <richard.sandiford@linaro.org> To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [05/77] Small tweak to array_value_type References: <8760ewohsv.fsf@linaro.org> Date: Thu, 13 Jul 2017 09:39:39 +0100 In-Reply-To: <8760ewohsv.fsf@linaro.org> (Richard Sandiford's message of "Thu, 13 Jul 2017 09:35:44 +0100") Message-ID: <87k23cn31w.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain |
Series |
Add wrapper classes for machine_modes
|
expand
|
On 07/13/2017 02:39 AM, Richard Sandiford wrote: > Store the type mode in a variable so that a later, > more mechanical patch can change its type. > > 2017-07-13 Richard Sandiford <richard.sandiford@linaro.org> > Alan Hayward <alan.hayward@arm.com> > David Sherwood <david.sherwood@arm.com> > > gcc/ > * tree-switch-conversion.c (array_value_type): Only read TYPE_MODE > once. Use get_narrowest_mode instead of GET_CLASS_NARROWEST_MODE. OK. jeff
Index: gcc/tree-switch-conversion.c =================================================================== --- gcc/tree-switch-conversion.c 2017-06-30 12:50:38.647644058 +0100 +++ gcc/tree-switch-conversion.c 2017-07-13 09:18:22.307345334 +0100 @@ -1034,7 +1034,6 @@ array_value_type (gswitch *swtch, tree t { unsigned int i, len = vec_safe_length (info->constructors[num]); constructor_elt *elt; - machine_mode mode; int sign = 0; tree smaller_type; @@ -1048,8 +1047,9 @@ array_value_type (gswitch *swtch, tree t if (!INTEGRAL_TYPE_P (type)) return type; - mode = GET_CLASS_NARROWEST_MODE (GET_MODE_CLASS (TYPE_MODE (type))); - if (GET_MODE_SIZE (TYPE_MODE (type)) <= GET_MODE_SIZE (mode)) + machine_mode type_mode = TYPE_MODE (type); + machine_mode mode = get_narrowest_mode (type_mode); + if (GET_MODE_SIZE (type_mode) <= GET_MODE_SIZE (mode)) return type; if (len < (optimize_bb_for_size_p (gimple_bb (swtch)) ? 2 : 32)) @@ -1087,7 +1087,7 @@ array_value_type (gswitch *swtch, tree t mode = GET_MODE_WIDER_MODE (mode); if (mode == VOIDmode - || GET_MODE_SIZE (mode) >= GET_MODE_SIZE (TYPE_MODE (type))) + || GET_MODE_SIZE (mode) >= GET_MODE_SIZE (type_mode)) return type; } }