From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23836 invoked by alias); 2 Feb 2015 03:15:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 23812 invoked by uid 89); 2 Feb 2015 03:15:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 02 Feb 2015 03:15:36 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t123FZ1m008197 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 1 Feb 2015 22:15:35 -0500 Received: from reynosa.quesejoda.com (vpn-57-190.rdu2.redhat.com [10.10.57.190]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t123FXaK016747; Sun, 1 Feb 2015 22:15:34 -0500 Message-ID: <54CEEBD5.7090608@redhat.com> Date: Mon, 02 Feb 2015 03:15:00 -0000 From: Aldy Hernandez User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Jason Merrill CC: Richard Biener , gcc-patches Subject: Re: [debug-early] C++ clones and limbo DIEs References: <54B87E5B.1090502@redhat.com> <54B88149.1040906@redhat.com> <54B94F4D.4040009@redhat.com> <54B97854.7040007@redhat.com> <54C296B5.4050506@redhat.com> <54C7FA41.8010903@redhat.com> <54C92A59.4070401@redhat.com> <54C92A80.80306@redhat.com> <54C92FA8.9040005@redhat.com> <54CBEB69.3000401@redhat.com> <54CBFFE7.1010003@redhat.com> <54CC1885.5010105@redhat.com> <54CDC625.8070902@redhat.com> In-Reply-To: <54CDC625.8070902@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2015-02/txt/msg00028.txt.bz2 On 01/31/2015 10:22 PM, Jason Merrill wrote: > On 01/30/2015 06:49 PM, Aldy Hernandez wrote: >> + FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node) >> + if (DECL_ABSTRACT_ORIGIN (node->decl)) > > If we do this for all functions, not just those with > DECL_ABSTRACT_ORIGIN set... > >> + /* FIXME: What does this do for templates? I think we don't want to >> + send a template off to early_global_decl, but rather walk through >> + its specializations and emit them. */ >> for (tree t = level->names; t; t = TREE_CHAIN(t)) >> debug_hooks->early_global_decl (t); > > ...could we drop this hunk? Well, we'd also have to output globals, which we're currently not doing in finalize_compilation_unit. But if you're ok with generating early dwarf for functions as well as globals/statics from finalize_compilation_unit() then we could get rid of virtually every call to early_global_decl() from the front-ends. So instead of FOR_EACH_*FUNCTION*, we could have: + symtab_node *node; + FOR_EACH_SYMBOL (node) + { + cgraph_node *cn = dyn_cast (node); + /* Global symbols get early debug information regardless, but + functions need to be visible. */ + if (!cn || cn->has_gimple_body_p ()) + (*debug_hooks->early_global_decl) (node->decl); + } Is this what you have in mind, or did you want to handle globals separately? Do keep in mind that the above snippet would have the side-effect of not creating debug information for optimized away global statics. I assume this is intended or acceptable? Thanks. Aldy