From patchwork Wed Jan 10 10:50:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 858214 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-470647-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="CCHxarfs"; dkim-atps=neutral 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 3zGm4N5lmSz9ryk for ; Wed, 10 Jan 2018 21:50:11 +1100 (AEDT) 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:subject:message-id:mime-version:content-type; q=dns; s= default; b=E8OdCUmd1VXZPt0p/0jJb6WSfaLNAUCmL8niJ8pFkmqzGY7YQEIt4 kHImNmtZrkYL0fzj1y5MpWKy9YVoWCj2XIXZj3KWmhi5dJQWGMwt9i/e/XO3zld2 CXXcrCgw+vd4GYn3U5SUrksDo5XaPy5rxyQHItOk3v8jKaFW6FnDBM= 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:subject:message-id:mime-version:content-type; s= default; bh=o5vo9l9G8tIEIRr2T3qoHAb3mhE=; b=CCHxarfsvq9xGFC4pIBn 6vlKTpuH7cSoC/0QZy5uh+LXcVNMjfObE2U7ZxaZYt5z65KXQRi3rbLMVxFJDXmj xfIhPuxXwqdoji1PWoPqazLE96H3DjDT6eFsMg3xoDOiIZf/Li0K83pIWjL1jC7u +Ru4eXJFU/hAIIc2LsHgsAs= Received: (qmail 26797 invoked by alias); 10 Jan 2018 10:50:05 -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 26460 invoked by uid 89); 10 Jan 2018 10:50:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 10 Jan 2018 10:50:03 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4409BAD8F for ; Wed, 10 Jan 2018 10:50:01 +0000 (UTC) Date: Wed, 10 Jan 2018 11:50:00 +0100 (CET) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR83765 Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 The following fixes LTO bootstrap with Ada enabled which currently fails in the attribute duplicate sanity checking I added last year. The reason is we end up with a BLOCK_NONLOCALIZED_VARS function decl inlined somewhere (thus has received a self-origin from dwarf2out) and referenced in a function inlined twice. Then gen_subprgram_die ends up adding DW_AT_declaration multiple times. The fix is to elide the old_die && declaration handling (do nothing) to also cover the origin != NULL case. LTO bootstrap and regular bootstrap / testing in progress on x86_64-unknown-linux-gnu. I'm going to commit this if no problems show up. Richard. 2018-01-10 Richard Biener PR debug/83765 * dwarf2out.c (gen_subprogram_die): Hoist old_die && declaration early out so it also covers the case where we have a non-NULL origin. Index: gcc/dwarf2out.c =================================================================== --- gcc/dwarf2out.c (revision 256378) +++ gcc/dwarf2out.c (working copy) @@ -22044,6 +22044,11 @@ gen_subprogram_die (tree decl, dw_die_re int declaration = (current_function_decl != decl || class_or_namespace_scope_p (context_die)); + /* A declaration that has been previously dumped needs no + additional information. */ + if (old_die && declaration) + return; + /* Now that the C++ front end lazily declares artificial member fns, we might need to retrofit the declaration into its class. */ if (!declaration && !origin && !old_die @@ -22084,11 +22089,6 @@ gen_subprogram_die (tree decl, dw_die_re much as possible. */ else if (old_die) { - /* A declaration that has been previously dumped needs no - additional information. */ - if (declaration) - return; - if (!get_AT_flag (old_die, DW_AT_declaration) /* We can have a normal definition following an inline one in the case of redefinition of GNU C extern inlines.