From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90613 invoked by alias); 24 Jul 2018 15:08:10 -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 90143 invoked by uid 89); 24 Jul 2018 15:08:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_NUMSUBJECT,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Jul 2018 15:08:08 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2E577B043; Tue, 24 Jul 2018 15:08:06 +0000 (UTC) Date: Tue, 24 Jul 2018 15:08:00 -0000 From: Richard Biener To: gcc-patches@gcc.gnu.org cc: jason@redhat.com Subject: [PATCH] Fix PR86654 Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2018-07/txt/msg01393.txt.bz2 I am testing the following patch to avoid forcing DIEs for a type context for method clones late via limbo processing. Instead hang them off comp_unit_die if there is no early DIE for the function. One question is whether the comment "If we're a nested function" matches up with the decl_function_context (decl) check or whether we really wanted to check DECL_CONTEXT (decl) == FUNCTION_DECL which would have made this particular case not match (DECL_CONTEXT is a RECORD_TYPE which context is a FUNCTION_DECL). Another option is of course to make clones not inherit DECL_CONTEXT from the cloned function (for an artificial instance the "context" is somewhat arbitrary since it isn't going to be found by lookup). In fact I long wanted to represent clones as artificial containers for an inline instance of the cloned function... LTO bootstrap and regtest running on x86_64-unknown-linux-gnu. If that succeeds I'm going to apply it as a stop-gap measure to make Firefox build again with LTO but I'm open to revising it. Richard. 2018-07-24 Richard Biener PR debug/86654 * dwarf2out.c (dwarf2out_decl): Do not handle nested functions special wrt context_die late. Index: gcc/dwarf2out.c =================================================================== --- gcc/dwarf2out.c (revision 262948) +++ gcc/dwarf2out.c (working copy) @@ -26702,8 +26702,11 @@ dwarf2out_decl (tree decl) case FUNCTION_DECL: /* If we're a nested function, initially use a parent of NULL; if we're a plain function, this will be fixed up in decls_for_scope. If - we're a method, it will be ignored, since we already have a DIE. */ - if (decl_function_context (decl) + we're a method, it will be ignored, since we already have a DIE. + Avoid doing this late though since clones of class methods may + otherwise end up creating type DIEs late. */ + if (early_dwarf + && decl_function_context (decl) /* But if we're in terse mode, we don't care about scope. */ && debug_info_level > DINFO_LEVEL_TERSE) context_die = NULL;