From patchwork Tue Oct 10 14:47:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 823893 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-463868-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="L+3FImvN"; dkim-atps=neutral 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 3yBKj32jFPz9tY3 for ; Wed, 11 Oct 2017 01:47:51 +1100 (AEDT) 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=h8YWD7nzqNa0BOnuumkL6odu0ZJgnlVzW11rtku4gTcWxHzLnj 6taf9SpjcXlz4bV3iRsjLRNPfDjn8gnyXMLK6pSdhtwkAN+E8LHteP6A2vJFULIK +97KrrgiQ5t6F1DFlkHMuW/z3rT8e0k/kqz6Caejnm/lVUw3KsS5HlIRE= 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=NdDPUwzS7zYXTQKb/eXHjOnOe5s=; b=L+3FImvNUeKXJllptKqO AZbuq/j//x+TsyB79+jQ9Vb4xTRyZGPww8Z01ofb5F1LqiZG7n1RWux+HylBWQkE kchlkCytkFWre1rTDV2XIuM3orUVwPgw5Sh3yi6ReTJbsruk/T0c9nnut9YdacSS FaP3MH0W636Ipb5pxnWwN44= Received: (qmail 52205 invoked by alias); 10 Oct 2017 14:47:43 -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 51301 invoked by uid 89); 10 Oct 2017 14:47:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-12.1 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=habit, Hx-languages-length:1513 X-HELO: mail-qt0-f182.google.com Received: from mail-qt0-f182.google.com (HELO mail-qt0-f182.google.com) (209.85.216.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Oct 2017 14:47:41 +0000 Received: by mail-qt0-f182.google.com with SMTP id p1so14593711qtg.2 for ; Tue, 10 Oct 2017 07:47:40 -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=Ec8X5ek6hfM/8HSUz+NUoZjyGy9KM7RuJszK53izPdc=; b=Uv6w/xBjOxJMqu6qj9qZ324fpM7R650KHLBEYq3JuMiEbqEg6FCn//TuN1SYYe/CYm b+yFMmVjbTga283rTmMaFpxZsFk8niCc/ScYBv8XVgzUeFtBCNvv4pMboGZXdwQltzWH 3fBw/M0FdJdF0KxQ7Fj1uTSIwQVxjXGME3uk8BeOXdXoFb3BZey5t2u0q3DHbQWhv9CY H++tb2uPjKVjQCl1vlU3+mikthw38EBLRPGUOhNDb/cZHwsq1aM3Hq2izwb5PLNd32pL TdMBGaWUVMEBlbwyxQMXnu9SizQw+2Ao43Pecl69XVl1OqPldHOgqNsQ3UjpTfzqsNni woOw== X-Gm-Message-State: AMCzsaX4RWJlMg9K/w10V+4LiLi77jdgSP2aKGrxTIrEdmVvhSGv8mbx stZGjYtoyC8LDwta3Ds9RgU= X-Google-Smtp-Source: AOwi7QCpT+/djzNx7amKnw3qJBZpldx759QtDbykDH8YMCTWxcqDrC3KvCou7Gg08t3PpSzdxSrSjA== X-Received: by 10.37.109.66 with SMTP id i63mr2226893ybc.414.1507646859229; Tue, 10 Oct 2017 07:47:39 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a3:20fb:7500:e7fb:4a6f:2254? ([2620:10d:c091:200::3:9bf7]) by smtp.googlemail.com with ESMTPSA id v38sm2552769ywh.36.2017.10.10.07.47.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Oct 2017 07:47:38 -0700 (PDT) To: GCC Patches From: Nathan Sidwell Subject: [C++ PATCH] set_global_binding tweak Message-ID: <62193b2d-a4df-5ca9-95dd-16f238aa4a92@acm.org> Date: Tue, 10 Oct 2017 10:47:37 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 It turns out that we no longer have to worry about the stat hack when pushing internal decls into the global namespace. I think it was last week's change to record_builtin_type, which did have the habit of pushing duplicates before that. Applying to trunk. nathan 2017-10-10 Nathan Sidwell * name-lookup.c (set_global_binding): Don't deal with STAT_HACK. Index: name-lookup.c =================================================================== --- name-lookup.c (revision 253502) +++ name-lookup.c (working copy) @@ -4858,22 +4858,13 @@ set_global_binding (tree decl) bool subtime = timevar_cond_start (TV_NAME_LOOKUP); tree *slot = find_namespace_slot (global_namespace, DECL_NAME (decl), true); - tree old = MAYBE_STAT_DECL (*slot); - if (!old) - *slot = decl; - else if (old == decl) - ; - else if (!STAT_HACK_P (*slot) - && TREE_CODE (decl) == TYPE_DECL && DECL_ARTIFICIAL (decl)) - *slot = stat_hack (old, decl); - else if (!STAT_HACK_P (*slot) - && TREE_CODE (old) == TYPE_DECL && DECL_ARTIFICIAL (old)) - *slot = stat_hack (decl, old); - else - /* The user's placed something in the implementor's - namespace. */ - diagnose_name_conflict (decl, old); + if (*slot) + /* The user's placed something in the implementor's namespace. */ + diagnose_name_conflict (decl, MAYBE_STAT_DECL (*slot)); + + /* Force the binding, so compiler internals continue to work. */ + *slot = decl; timevar_cond_stop (TV_NAME_LOOKUP, subtime); }