From patchwork Tue Nov 1 23:08:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mark Wielaard X-Patchwork-Id: 690217 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 3t7n356T75z9t2G for ; Wed, 2 Nov 2016 10:08:32 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=olWSeWZP; 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 :from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; q=dns; s= default; b=d2K5m248Kut+aU3JZw2xgUu8OQ/VcntmXFCT4Gfxs4Meidi0Rtxkw c5yxQaiMayaOrlSzA8fBYxD6tNAK9tlY4Yyfat2Q8QseHpWV3/hGWGNRVqqnbt0r 5HyoMj/JQbPEMOca9gGDY+N1fj4ZGRcni89IGu8Rv07vkXmltmo5Uc= 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 :from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=default; bh=MHDGa05M2Ww2d54IB3TGXI1v8/k=; b=olWSeWZP5iZ5SmgdLGQHoJjIgvLs xZTzQmubvRh0qmXCdh5kCmsBuYCuqOG30mbKnT2zni017ITLDauctJPAhayyn7uh H/J5mlhC7VRgFgQx5YWNSmu+qEjA5ayJb/B3URN8BvsZ7Og2ClRXvrCcBxLErBA1 XjWT7L+KLgoISfI= Received: (qmail 61463 invoked by alias); 1 Nov 2016 23:08:04 -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 61435 invoked by uid 89); 1 Nov 2016 23:08:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=201612, repetition X-HELO: tarox.wildebeest.org Received: from herd.wildebeest.org (HELO tarox.wildebeest.org) (80.127.118.209) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 01 Nov 2016 23:08:02 +0000 Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 16A6640A71C1; Wed, 2 Nov 2016 00:08:00 +0100 (CET) Date: Wed, 2 Nov 2016 00:08:00 +0100 From: Mark Wielaard To: Jason Merrill Cc: Jakub Jelinek , gcc-patches List Subject: Re: [PATCH] Emit DW_AT_inline for C++17 inline variables (take 2) Message-ID: <20161101230800.GA11998@tarox.wildebeest.org> References: <20161014173321.GM7282@tucnak.redhat.com> <20161031142501.GE3541@tucnak.redhat.com> <20161101161036.GW3541@tucnak.redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) On Tue, Nov 01, 2016 at 01:20:23PM -0400, Jason Merrill wrote: > On Tue, Nov 1, 2016@12:10 PM, Jakub Jelinek wrote: > > + && !get_AT (var_die, DW_AT_inline) > > + && (origin_die == NULL || get_AT (origin_die, DW_AT_inline) == NULL) > > Can we drop this repetition (here and for DW_AT_const_expr)? get_AT > should look through DW_AT_abstract_origin, and we should have added > that earlier in gen_variable_die. > > OK with that change. That seemed to have been the last usage of origin_die in gen_variable_die. So removing that caused: /home/mark/src/gcc/gcc/dwarf2out.c: In function ‘void gen_variable_die(tree, tree, dw_die_ref)’: /home/mark/src/gcc/gcc/dwarf2out.c:22454:14: error: variable ‘origin_die’ set but not used [-Werror=unused-but-set-variable] dw_die_ref origin_die = NULL; ^~~~~~~~~~ cc1plus: all warnings being treated as errors make[3]: *** [dwarf2out.o] Error 1 The following seems to work around that and makes things build again for me: Cheers, Mark diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 5ff6f97..24b85c1 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -22451,7 +22451,6 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die) tree ultimate_origin; dw_die_ref var_die; dw_die_ref old_die = decl ? lookup_decl_die (decl) : NULL; - dw_die_ref origin_die = NULL; bool declaration = (DECL_EXTERNAL (decl_or_origin) || class_or_namespace_scope_p (context_die)); bool specialization_p = false; @@ -22627,7 +22626,7 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die) var_die = new_die (DW_TAG_variable, context_die, decl); if (origin != NULL) - origin_die = add_abstract_origin_attribute (var_die, origin); + add_abstract_origin_attribute (var_die, origin); /* Loop unrolling can create multiple blocks that refer to the same static variable, so we must test for the DW_AT_declaration flag.