From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56534 invoked by alias); 13 Apr 2015 18:01:54 -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 56012 invoked by uid 89); 13 Apr 2015 18:01:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 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, 13 Apr 2015 18:01:53 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3DI1qhS019991 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 13 Apr 2015 14:01:52 -0400 Received: from reynosa.quesejoda.com (vpn-63-120.rdu2.redhat.com [10.10.63.120]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3DI1oBj021912; Mon, 13 Apr 2015 14:01:51 -0400 Message-ID: <552C048B.9020804@redhat.com> Date: Mon, 13 Apr 2015 18:01:00 -0000 From: Aldy Hernandez User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Jason Merrill CC: gcc-patches Subject: Re: [debug-early] Handle specification of class scoped static functions References: <550C5F3A.1030802@redhat.com> <550C8F4C.1020003@redhat.com> <550CB740.6040305@redhat.com> <551EA84E.7080200@redhat.com> In-Reply-To: <551EA84E.7080200@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2015-04/txt/msg00602.txt.bz2 On 04/03/2015 07:48 AM, Jason Merrill wrote: > On 03/20/2015 08:11 PM, Aldy Hernandez wrote: >> + /* For class scoped static functions, the dumped early >> + version was the declaration, whereas the next time >> + around with a different context should be the >> + specification. In this case, avoid reusing the DIE, but >> + generate a specification below. E.g.: >> + >> + class C { >> + public: >> + static void moo () {} >> + }; */ >> + || !is_cu_die (context_die)) > > Why do we still need this added (relative to trunk)? Are we getting > here multiple times with class context_die? Apparently we no longer need it for the C++ case above, so the comment certainly needs updating, but we need it for fortran: module some_m contains logical function funky (FLAG) funky = .true. end function end module The first time through gen_subprogram_die() we generate the DIE with a context of DW_TAG_module (early dwarf). The second time, in late dwarf, we get here with a DW_TAG_module context again, so the above code will allow us to reuse the DIE, instead of creating a DW_AT_specification. ...or perhaps we could change the condition to: if ((is_cu_die (old_die->die_parent) + || old_die->die_parent->die_tag == DW_TAG_module || context_die == NULL ?? Aldy