From patchwork Mon Jun 19 14:21:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 777788 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 3wrtT46WLZz9s2G for ; Tue, 20 Jun 2017 00:21:43 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="QDT4KYcq"; 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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=CvagndOxx9s9fguQoxEvgXSWOZ9ENfEGPqfPuDIzQqwXVaA1QD XByppe/u5qHvrHY3D/O1CoDtY7CCB7EsNAeK6JaBDpkeLsdnostcNcNBAH2fKNrx GrtjWGiQd73d5bE/B4CPgzTR5IGsmFm20r/RVHR4f6Hytm3ufUKnCt9bE= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=7XPPFyATNZiUZThFNoMsWt0lJg4=; b=QDT4KYcqpHgg0sECwWn5 O6Pmy8IZ08VoMpZlxBCv5JMTXH29aMuDX6gQsZGx38Wq/Lm1QfVdsT+iIZq1dG4t A65QJVdIhn/5kBzUODVnKmL2c2S2oEWpqdePICUklPO5x45oPo/vqblVM/CsyJ+l cMNBE/GMPWi35fw4/blBxt4= Received: (qmail 85609 invoked by alias); 19 Jun 2017 14:21:29 -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 84877 invoked by uid 89); 19 Jun 2017 14:21:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=forgotten X-HELO: mail-yw0-f180.google.com Received: from mail-yw0-f180.google.com (HELO mail-yw0-f180.google.com) (209.85.161.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 Jun 2017 14:21:26 +0000 Received: by mail-yw0-f180.google.com with SMTP id v7so41012074ywc.2 for ; Mon, 19 Jun 2017 07:21:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language; bh=LKc8EkatSTjPcZpSRafHQcVAlKQBrVP+Wo/OCEzN7Pk=; b=m479L+WIWPD3HFwvN5Ybjuh0pnk6VXop8DcliaEfPB1WewduulEcniCoKTzNfhRieT 4fTod4ZUrX9Icd8DTV6r06Y5uh7Gr4bwK6LfsEwI/qUmzvwtKosLYOqsZQGZuw6BTyD8 9eS62g9MZ9fFPIb8CRFR6rqZKfaNZelF0s5Hm/2Vbd16xDxBxl64GFBBvcUNQLZCJG2A /3ozgYFqrbvuBLuc+65Y4Qn08/AFIqc1OAAi0+evwPpUxX+MZ/MbgWJAMObim9rTwylH 3k61FBeQ+nQ62is8tyGFkxBvO2wts1lZ3e9f7eLHftWX4hFR9pqHIGCkJeo4imhwRhoW eI6g== X-Gm-Message-State: AKS2vOyLe/hSlHkvLIfDc8UC+fMv1mRX5+Fo5Us/DszVlKbstD2jf4uJ 6jSj5bmMQxDB4Q== X-Received: by 10.129.72.82 with SMTP id v79mr19942265ywa.156.1497882090138; Mon, 19 Jun 2017 07:21:30 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a3:20fb:7500:e7fb:4a6f:2254? ([2620:10d:c091:200::144]) by smtp.googlemail.com with ESMTPSA id x65sm2055183ywa.1.2017.06.19.07.21.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Jun 2017 07:21:29 -0700 (PDT) To: GCC Patches From: Nathan Sidwell Subject: [C++ PATCH] small pt.c cleanup Message-ID: <51b06187-3093-7643-46c8-ba869d339b68@acm.org> Date: Mon, 19 Jun 2017 10:21:28 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 I discovered a cleanup I'd forgotten about. The only unobvious thing about this patch is that just before the second hunk we've already set DECL_RTL to NULL. No need to do it twice. nathan 2017-06-19 Nathan Sidwell * pt.c (coerce_template_parms): Fix indentation. (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling in to single block. Index: pt.c =================================================================== --- pt.c (revision 249364) +++ pt.c (working copy) @@ -8101,10 +8101,10 @@ coerce_template_parms (tree parms, parm = TREE_VEC_ELT (parms, parm_idx); if (parm == error_mark_node) - { - TREE_VEC_ELT (new_inner_args, arg_idx) = error_mark_node; - continue; - } + { + TREE_VEC_ELT (new_inner_args, arg_idx) = error_mark_node; + continue; + } /* Calculate the next argument. */ if (arg_idx < nargs) @@ -12947,13 +12947,11 @@ tsubst_decl (tree t, tree args, tsubst_f /* The initializer must not be expanded until it is required; see [temp.inst]. */ DECL_INITIAL (r) = NULL_TREE; - if (VAR_P (r)) - SET_DECL_MODE (r, VOIDmode); - if (CODE_CONTAINS_STRUCT (TREE_CODE (t), TS_DECL_WRTL)) - SET_DECL_RTL (r, NULL); DECL_SIZE (r) = DECL_SIZE_UNIT (r) = 0; if (VAR_P (r)) { + SET_DECL_MODE (r, VOIDmode); + /* Possibly limit visibility based on template args. */ DECL_VISIBILITY (r) = VISIBILITY_DEFAULT; if (DECL_VISIBILITY_SPECIFIED (t))