Message ID | 87bmooiuv5.fsf@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1933292qge; Thu, 13 Jul 2017 01:51:15 -0700 (PDT) X-Received: by 10.99.104.129 with SMTP id d123mr8017585pgc.236.1499935875597; Thu, 13 Jul 2017 01:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499935875; cv=none; d=google.com; s=arc-20160816; b=rHKG45Ft70hyWW84yLAN+5azU6ZCvk7rg4eEC8varpZcLC9+UdtkBOKDERxWAi1XI2 f10yT1tSjr+VNYlltSc/zMz58Uka66RvTkrGfZ45pphbJAuEd3KNy9uP2q4ZQ+jY88oa QqxA8SuzGuz8nHD53NyZVrhhbfczj3jWs1RKAkt0vLt53nFVj+4JQ007flNeol1SDSkG bdEkcEo14Qw2XU5L8Siqd37O4YLpiHCSpfuC4tePyu7D5SCGadLCzmSX9XBFvR/CZdwG 1BasurrtP5Ovf7fgIdvcBvdnql0/SWHx+1h8iaxxsgbjWXHUhE8BF1Tl5Qs0JtxpGYgj sTQQ== 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=5DQhvP2EaLcjpbNV18pGPE4T/f+gVRH8ZG/xYiqyRcM=; b=lrYfKOPjS5Ovw/z6fRAMwQAkNNcKPvQ4FJGXjheY9Dq5MipwgQfFiSGJenP4Ck+x1A 1RisnQ5dLnpk1/dbgRWUsqxM/+zmZvmCfBa8HCkoNLkutF1kBipZ+hkxr8hUYH0mKHuY Ez3vQf8tn9UHwzXrpCYYDdwEm2mMr6AmI686gNw5SfPESjyLPE7DlnfxndwxUeO54LZG UuWd5BPZHXNpfAaptqVdudKZaQdvacGEhsBDWeCZPxUA4yCwTWwGI7ixaQcAI8BvDR0Z Z/GnKCiVHOJezXA8AYH1vTJJHhHbyQRIO6vyxXgQFyThqODTUEp6FFgb0kA+GvqcZ8Dr SuDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.b=DHq7itT+; spf=pass (google.com: domain of gcc-patches-return-458023-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-458023-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <gcc-patches-return-458023-patch=linaro.org@gcc.gnu.org> Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id m24si3984937pli.323.2017.07.13.01.51.15 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jul 2017 01:51:15 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-458023-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=DHq7itT+; spf=pass (google.com: domain of gcc-patches-return-458023-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-458023-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=DdJS49WUMx2hjHd/X/G78s9WzJyRJ CXozZ4VMWijNqsjIT9dblFwjgAsFiu7Fmd7ahLKPSJXsWoMF88KQg3EI9ECoPX9g YbskhZkbUO2HIHmiORTUByekGow3/k/lFCcob4JsSry6o6iBalN+DPaVv6jgzB9+ XCtHbK42GKkT/g= 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=DLrpz9MCYlfu7cYSMd9G/7sBG8w=; b=DHq 7itT+rXWmDgxF6hZWA5mcwJrbXsyyIz/RuGOEITFcPQ2tRjpRONgvr070+sfMIH7 s+G3TALoykqgCugLWLiDJiQOAGc9sihsl05t0uISfnWhWJN3xmuGSl+FhkyP8+PT /F2ImxWNdb/vUo1NLIEoNLs+X3vKEbWiCpR1f2dY= Received: (qmail 79076 invoked by alias); 13 Jul 2017 08:50:14 -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 78400 invoked by uid 89); 13 Jul 2017 08:50:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.8 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= X-HELO: mail-wm0-f53.google.com Received: from mail-wm0-f53.google.com (HELO mail-wm0-f53.google.com) (74.125.82.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Jul 2017 08:50:11 +0000 Received: by mail-wm0-f53.google.com with SMTP id f67so18242857wmh.1 for <gcc-patches@gcc.gnu.org>; Thu, 13 Jul 2017 01:50:10 -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=5DQhvP2EaLcjpbNV18pGPE4T/f+gVRH8ZG/xYiqyRcM=; b=JPip38Xnu3Y7n3ylplfY59T5TYMIginZed0Ju7KUHBpwcOaI52aiT18xBAKrXIpUHH WXELwZyuQK09vRicW9vBmyCfIuYPGE56JjiyMi3rNakEfLbULQkrciz1C/u4RP2WVVmY hLHKrsnz/LK3bxluOqj+PorxsyMoM79L9nyXt20hNcDaruOSGVMkKuvSw1jxrXdWT+gv 4fTXLHyFpB9wjmwmBU50PPGF/9jV5KPjt3zTp84sg2sWaH9UdErJUfkz4abvjWC72oX1 WNM4jSBUThnZc9THVlT+NOiJN5nQdSMb1qVrrXSyBYGTyu62wDOOzV0E2YmlzYQ25zTF lqpQ== X-Gm-Message-State: AIVw111o86ylbjRMdkqb9tPAH8AJ0p1sXPgRrXWcVE2IZxSoGI1xAPDX DXLI0toc2WqcHoI3qhluwQ== X-Received: by 10.28.71.133 with SMTP id m5mr1125615wmi.97.1499935808813; Thu, 13 Jul 2017 01:50:08 -0700 (PDT) Received: from localhost (92.40.249.184.threembb.co.uk. [92.40.249.184]) by smtp.gmail.com with ESMTPSA id b197sm4849950wmb.4.2017.07.13.01.50.07 for <gcc-patches@gcc.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jul 2017 01:50:08 -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: [32/77] Check is_a <scalar_int_mode> before calling valid_pointer_mode References: <8760ewohsv.fsf@linaro.org> Date: Thu, 13 Jul 2017 09:50:06 +0100 In-Reply-To: <8760ewohsv.fsf@linaro.org> (Richard Sandiford's message of "Thu, 13 Jul 2017 09:35:44 +0100") Message-ID: <87bmooiuv5.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:50 AM, Richard Sandiford wrote: > A future patch will make valid_pointer_mode take a scalar_int_mode > instead of a machine_mode. is_a <...> rather than as_a <...> is > needed here because we're checking a mode supplied by the user. > > 2017-07-13 Richard Sandiford <richard.sandiford@linaro.org> > Alan Hayward <alan.hayward@arm.com> > David Sherwood <david.sherwood@arm.com> > > gcc/c-family/ > * c-attribs.c (handle_mode_attribute): Check for a scalar_int_mode > before calling targetm.addr_space.valid_pointer_mode. OK. jeff
Index: gcc/c-family/c-attribs.c =================================================================== --- gcc/c-family/c-attribs.c 2017-06-30 12:50:37.302706033 +0100 +++ gcc/c-family/c-attribs.c 2017-07-13 09:18:37.622901759 +0100 @@ -1438,10 +1438,12 @@ handle_mode_attribute (tree *node, tree if (POINTER_TYPE_P (type)) { + scalar_int_mode addr_mode; addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (type)); tree (*fn)(tree, machine_mode, bool); - if (!targetm.addr_space.valid_pointer_mode (mode, as)) + if (!is_a <scalar_int_mode> (mode, &addr_mode) + || !targetm.addr_space.valid_pointer_mode (addr_mode, as)) { error ("invalid pointer mode %qs", p); return NULL_TREE; @@ -1451,7 +1453,7 @@ handle_mode_attribute (tree *node, tree fn = build_pointer_type_for_mode; else fn = build_reference_type_for_mode; - typefm = fn (TREE_TYPE (type), mode, false); + typefm = fn (TREE_TYPE (type), addr_mode, false); } else {