From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21517 invoked by alias); 26 Sep 2014 18:17:11 -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 21507 invoked by uid 89); 26 Sep 2014 18:17:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS 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; Fri, 26 Sep 2014 18:17:09 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8QIH7pk018077 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 26 Sep 2014 14:17:08 -0400 Received: from reynosa.quesejoda.com (vpn-59-2.rdu2.redhat.com [10.10.59.2]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8QIH6kj025151 for ; Fri, 26 Sep 2014 14:17:07 -0400 Message-ID: <5425ADA2.9030807@redhat.com> Date: Fri, 26 Sep 2014 18:17:00 -0000 From: Aldy Hernandez User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: gcc-patches Subject: [debug-early] reuse old DIE if it was dumped early Content-Type: multipart/mixed; boundary="------------040008010105030400020701" X-SW-Source: 2014-09/txt/msg02422.txt.bz2 This is a multi-part message in MIME format. --------------040008010105030400020701 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 770 I'm not sure, but somewhere along the last few commits I caused a regression that inhibits libgfortran from building. Serves me right for forgetting to rebuild all the target libraries after each patch. For some instances of subprograms, we do not reuse the prexisting die, and we trigger the check I had added here: /* If we early created a DIE, make sure it didn't get re-created by mistake. */ if (early_die && early_die->dumped_early) gcc_assert (early_die == die); Since we already have the dumped_early bit set for subprograms, we can just check that and proceed to reuse the previously generated die. Fixed. Cleaned some other trivia. Committed to branch. No guality regressions for any languages. All target libraries built. Aldy --------------040008010105030400020701 Content-Type: text/plain; charset=us-ascii; name="curr" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="curr" Content-length: 3318 commit 10d7286a26e8a0e29ecbbd0b362ecb8fcc8bfc62 Author: Aldy Hernandez Date: Fri Sep 26 11:11:27 2014 -0700 * dwarf2out.c (gen_subprogram_die): Use old die if it was dumped early. Rearrange some comments. (gen_variable_die): Move initialization of origin_die closer to use. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 339e547..41c4feb 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -18308,14 +18308,14 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) && !get_AT (old_die, DW_AT_inline)) { /* Detect and ignore this case, where we are trying to output - something we have already output. - - If we have no location information, this must be a - partially generated DIE from early dwarf generation. - Fall through and generate it. */ + something we have already output. */ if (get_AT (old_die, DW_AT_low_pc) || get_AT (old_die, DW_AT_ranges)) return; + + /* If we have no location information, this must be a + partially generated DIE from early dwarf generation. + Fall through and generate it. */ } /* If the definition comes from the same place as the declaration, @@ -18325,11 +18325,12 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) instances of inlines, since the spec requires the out-of-line copy to have the same parent. For local class methods, this doesn't apply; we just use the old DIE. */ - if ((is_cu_die (old_die->die_parent) || context_die == NULL) - && (DECL_ARTIFICIAL (decl) - || (get_AT_file (old_die, DW_AT_decl_file) == file_index - && (get_AT_unsigned (old_die, DW_AT_decl_line) - == (unsigned) s.line)))) + if (old_die->dumped_early + || ((is_cu_die (old_die->die_parent) || context_die == NULL) + && (DECL_ARTIFICIAL (decl) + || (get_AT_file (old_die, DW_AT_decl_file) == file_index + && (get_AT_unsigned (old_die, DW_AT_decl_line) + == (unsigned) s.line))))) { subr_die = old_die; @@ -18926,7 +18927,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; bool declaration = (DECL_EXTERNAL (decl_or_origin) || class_or_namespace_scope_p (context_die)); bool specialization_p = false; @@ -19050,6 +19050,8 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die) if (old_die && !declaration && !local_scope_p (context_die)) return; + dw_die_ref origin_die = NULL; + /* If a DIE was dumped early, it still needs location info. Skip to the part where we fill the location bits. */ if (old_die && old_die->dumped_early) @@ -19057,7 +19059,6 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die) gcc_assert (old_die->die_parent == context_die); var_die = old_die; old_die = NULL; - origin_die = NULL; goto gen_variable_die_location; } @@ -19069,7 +19070,6 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die) else var_die = new_die (DW_TAG_variable, context_die, decl); - origin_die = NULL; if (origin != NULL) origin_die = add_abstract_origin_attribute (var_die, origin); --------------040008010105030400020701--