From patchwork Mon Jul 26 16:45:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Edlinger X-Patchwork-Id: 1510143 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GYQmn6z4fz9sRK for ; Tue, 27 Jul 2021 02:46:33 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D4AC438618BD for ; Mon, 26 Jul 2021 16:46:30 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR06-AM7-obe.outbound.protection.outlook.com (mail-am7eur06olkn2016.outbound.protection.outlook.com [40.92.16.16]) by sourceware.org (Postfix) with ESMTPS id 2F050397B83F for ; Mon, 26 Jul 2021 16:45:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2F050397B83F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=hotmail.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hotmail.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ElATkmqxDoxfqLKnZEkPy6JqKCtm+t0MBPrr04HUOPQk/RdLCQD6Lw4cnhIfcuJ7pu1GWG3Iv8uTv3c0522ATwR391ATsLjkAIu0u247Cu5QXq88icyEagRwa/nfrEsji/VpGMWF3iNiI8g/pXIg0PBq8TreprZ/vV6ewg7erGowqV3qjYAPPhp8H771uDDrqc/c+YpITGnxNqYgp4yjt5jfQ2Yw96vw/ksoMrlUB/yWC5gKKbwVN20gCiWU371+1iVi1YYel8FzY0hd8P4l5ADf2YmFn2FH4LzXy+boMvGfcFWjR5il0EjifQIJhM96fY5i3piGtGNBpKXlrAYEuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eCa3xT7cOtfkaWRFGEySLRnGZPN583qUxaVzC6FCWOs=; b=FanWSq6DuYdXmqu6t8mHw+OdyKzFYANj5oRjlMH7VwIjiuOYMyRRRgQhkkGXAg5RLnl7zcaAnp/+Hw/AQOyA8yA6Gbf8KyCys2LWs+g9H5kWRdOe+/UIFfaR4P4YHHam6665qTyfplEhOKdiHI5ti/TyWlhFyhgQWZQtbkeQIygaNcAEWV3D1KCRsv98qBk5PnexX/g6+um916oIf612LVeX3ID1O8uthIqZuxVD1PDn/CeK0NdQkcdVeq4SFv1ShqzYwXpKy027SgM+JEZ43bve6/JT0H6ep1JbYAXYgGVwfQkjFTSGJD5T6x+32wHh6seIBVpvdyWuisiZ37Pd5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from DB8EUR06FT028.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc35::4c) by DB8EUR06HT029.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc35::299) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24; Mon, 26 Jul 2021 16:45:38 +0000 Received: from AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM (2a01:111:e400:fc35::40) by DB8EUR06FT028.mail.protection.outlook.com (2a01:111:e400:fc35::253) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24 via Frontend Transport; Mon, 26 Jul 2021 16:45:38 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:1AF6BCAC5F24807FF47AD678F709CCF2EFB40D2ABB0E4ACDDC62C8729242E2A8; UpperCasedChecksum:84D84D84CC6CD50967EF9AEA237CDCE1B5EF84F1289FB72D9DEAA6AA9F58D3F2; SizeAsReceived:7783; Count:45 Received: from AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM ([fe80::3d30:d151:570a:8a16]) by AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM ([fe80::3d30:d151:570a:8a16%8]) with mapi id 15.20.4352.031; Mon, 26 Jul 2021 16:45:38 +0000 To: "gcc-patches@gcc.gnu.org" , Richard Biener , Eric Botcazou , Arnaud Charlet From: Bernd Edlinger Subject: [PATCH 1/2] Fix debug info for ignored decls at start of assembly Message-ID: Date: Mon, 26 Jul 2021 18:45:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 Content-Language: en-US X-TMN: [RWqVWGFuEqNuV0i3wqZtU0xrDcXbSGDX] X-ClientProxiedBy: AM0PR02CA0001.eurprd02.prod.outlook.com (2603:10a6:208:3e::14) To AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:364::23) X-Microsoft-Original-Message-ID: <9b61dee3-bb43-ccbd-c2e3-af16935180fe@hotmail.de> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.101] (88.76.118.196) by AM0PR02CA0001.eurprd02.prod.outlook.com (2603:10a6:208:3e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24 via Frontend Transport; Mon, 26 Jul 2021 16:45:37 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 45 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 6f68eef9-2b3e-4fb7-8373-08d95054cc0d X-MS-TrafficTypeDiagnostic: DB8EUR06HT029: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZvenZ1Yllh/LbH/tEJNh8dpGVppIiPRqcbHpqAkbHxKW0ZO1QZUGggdnRwmkFirzNqeorVr15mDgOsyDX3bs3FGg17WEao1aJ8pgqTNBdK9OwBrNaV6E6P7hohj6Wt2DbI7SusYseAYSfg1NcIlWiLImC8fS0lSAnk1i0ORqmpoeiXx9k3ZXQ3Z0NMMM8QZDj+0vVCmELv6kYNyPTpgZlKCny1yGa8ZBMgA4GznECkIg/jMJKlaIFJfeaIGnapNQsstMR+2kUyyUiXGrkxNTCmfneTekibYU4k2xVcmNZQv+jhBTiDkVOXNhpF9bA6gEbXDW6Zd6ENC0k4AqJAwhqIp1aKONHfExkJ4S4DRog59JN1tLVEd4foehsBMouYrSse7GGdvhBHSgjbX6TQtZZol1zx/vbpJkOaA52DCSfKVhv6LsoMR8KC0bjAAGmQaK X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aqgRsyRyEZDEdiis0RKLdQ5Da1teZ0FFpbcNkBBzV+hJpndIdhKGWcoY2Z5fqXWdLviKnnPOy6+/viVdbAGt27xQZBFjc+iNDr3EgGv+5ueTHWWj0ZQgi4brb5Ru6qatWaZmpejblTPyJBzbpccuPw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f68eef9-2b3e-4fb7-8373-08d95054cc0d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2021 16:45:38.2649 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB8EUR06FT028.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8EUR06HT029 X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, FORGED_MUA_MOZILLA, FREEMAIL_FROM, GIT_PATCH_0, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Ignored functions decls that are compiled at the start of the assembly have bogus line numbers until the first .file directive, as reported in PR101575. The work around for this issue is to emit a dummy .file directive when the first function is DECL_IGNORED_P, when that is not already done, mostly for -fdwarf-4. 2021-07-24 Bernd Edlinger PR ada/101575 * dwarf2out.c (dwarf2out_begin_prologue): Move init of fde->ignored_debug to dwarf2out_set_ignored_loc. (dwarf2out_set_ignored_loc): This is now also called when no .loc statement is to be generated, in that case we emit a dummy .file statement when needed. * final.c (final_start_function_1, final_scan_insn_1): Call debug_hooks->set_ignored_loc for all DECL_IGNORED_P functions. --- gcc/dwarf2out.c | 29 +++++++++++++++++++++++++---- gcc/final.c | 5 ++--- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 884f1e1..8de0d6f 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -1115,7 +1115,6 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED, fde->dw_fde_current_label = dup_label; fde->in_std_section = (fnsec == text_section || (cold_text_section && fnsec == cold_text_section)); - fde->ignored_debug = DECL_IGNORED_P (current_function_decl); in_text_section_p = fnsec == text_section; /* We only want to output line number information for the genuine dwarf2 @@ -28546,10 +28545,32 @@ dwarf2out_set_ignored_loc (unsigned int line, unsigned int column, { dw_fde_ref fde = cfun->fde; - fde->ignored_debug = false; - set_cur_line_info_table (function_section (fde->decl)); + if (filename) + { + set_cur_line_info_table (function_section (fde->decl)); + + dwarf2out_source_line (line, column, filename, 0, true); + } + else + { + fde->ignored_debug = true; + + /* Work around for PR101575: output a dummy .file directive. */ + if (in_first_function_p + && debug_info_level >= DINFO_LEVEL_TERSE + && dwarf_debuginfo_p () +#if defined(HAVE_AS_GDWARF_5_DEBUG_FLAG) && defined(HAVE_AS_WORKING_DWARF_N_FLAG) + && dwarf_version <= 4 +#endif + && output_asm_line_debug_info ()) + { + const char *filename0 = get_AT_string (comp_unit_die (), DW_AT_name); - dwarf2out_source_line (line, column, filename, 0, true); + if (filename0 == NULL) + filename0 = ""; + maybe_emit_file (lookup_filename (filename0)); + } + } } /* Record the beginning of a new source file. */ diff --git a/gcc/final.c b/gcc/final.c index ac6892d..82a5767 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -1725,7 +1725,7 @@ final_start_function_1 (rtx_insn **firstp, FILE *file, int *seen, if (!dwarf2_debug_info_emitted_p (current_function_decl)) dwarf2out_begin_prologue (0, 0, NULL); - if (DECL_IGNORED_P (current_function_decl) && last_linenum && last_filename) + if (DECL_IGNORED_P (current_function_decl)) debug_hooks->set_ignored_loc (last_linenum, last_columnnum, last_filename); #ifdef LEAF_REG_REMAP @@ -2205,8 +2205,7 @@ final_scan_insn_1 (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED, } else if (!DECL_IGNORED_P (current_function_decl)) debug_hooks->switch_text_section (); - if (DECL_IGNORED_P (current_function_decl) && last_linenum - && last_filename) + if (DECL_IGNORED_P (current_function_decl)) debug_hooks->set_ignored_loc (last_linenum, last_columnnum, last_filename); From patchwork Mon Jul 26 16:45:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Edlinger X-Patchwork-Id: 1510144 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GYQnb3BBFz9sXG for ; Tue, 27 Jul 2021 02:47:14 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7C0E8397282C for ; Mon, 26 Jul 2021 16:47:12 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR06-DB8-obe.outbound.protection.outlook.com (mail-db8eur06olkn2014.outbound.protection.outlook.com [40.92.51.14]) by sourceware.org (Postfix) with ESMTPS id C6E823982023 for ; Mon, 26 Jul 2021 16:45:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C6E823982023 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=hotmail.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hotmail.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XI0VfEjcdp/O9/MWu/Er19uPHbasuDDTP5acttYJjqD7AtycUEWzlOd49hP08Et8HL8i/EJXqPvZnhU7nujOZObI4ly0O0wH514i2QzZJLupexpdJeYUMMuJWbGUWaRDCNZgNbTG3AKj6cOAT8bYYQeOp5kPygSK7Ie0o/1F4rcyuXDdzGcXErn2PjEXEaYen13zXrAMS3RVhX1a+WdmmckYtLVeb9HK59UZ6X0fwxtz9YTNAFHGp5TFyB0F2A9jxu0Ec5UauF1Rj58AnkKAH9LhBot501uPR4VRBA+fABXQpsekpPaTym5AQ+1fo8lxmgWkJ9kIg2NytjzQ1m907A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CYugP/5ADXrJ8jxF4jla9qCNGzdW3twyvbMgSRu8T3Y=; b=nsRKDYTTiq2+UYSsQ2y4FzpU/lHCVI3TvFOOFSAPWdsAj7ZXxvAUIW2OPXFDJu1cgICoewA7lgympfwrgSS0N+ZGBBtXJSC8P7DVsjdaG82a9tBWuaDCHikSmybzkcUkuclmImM6gRLxp/vXmQPw+PhwJQ1qoOdvC61pzKi+rhrUpNvus4PftIDsBhJCAsKTiTr5puEzeEtdlrx6rMWBmSNIM1lx383I7KA5DRPNJIpOsroBP0W1oTmtlX9NmpJd1Hdkig5My1YpT3BuUs1THe34QRW7MNZUjXZ17xXxOG9odnhx6pjrmKMiQbo5PbEPIdBYAdjLym7DCJ3/25MwLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from DB8EUR06FT028.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc35::44) by DB8EUR06HT145.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc35::174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24; Mon, 26 Jul 2021 16:45:47 +0000 Received: from AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM (2a01:111:e400:fc35::40) by DB8EUR06FT028.mail.protection.outlook.com (2a01:111:e400:fc35::253) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24 via Frontend Transport; Mon, 26 Jul 2021 16:45:47 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:0B9B56F9BA61A47B6C9AABFDF0D0C11A31D94399952C3B2D7C633A2B09BAB52F; UpperCasedChecksum:FC9253BF412C160CB3AF9CAE32C552FBC65E11702C63AF99EB3F9C5441A1A82C; SizeAsReceived:7800; Count:45 Received: from AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM ([fe80::3d30:d151:570a:8a16]) by AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM ([fe80::3d30:d151:570a:8a16%8]) with mapi id 15.20.4352.031; Mon, 26 Jul 2021 16:45:47 +0000 To: "gcc-patches@gcc.gnu.org" , Richard Biener , Eric Botcazou , Arnaud Charlet From: Bernd Edlinger Subject: [PATCH 2/2] Ada: Remove debug line number for DECL_IGNORED_P functions Message-ID: Date: Mon, 26 Jul 2021 18:45:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 Content-Language: en-US X-TMN: [3R084w9F0utIkEEErZ0dQqC8ATQBOJaT] X-ClientProxiedBy: AM0PR02CA0007.eurprd02.prod.outlook.com (2603:10a6:208:3e::20) To AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:364::23) X-Microsoft-Original-Message-ID: <2bc51121-1970-5f98-07c3-5fb69c473932@hotmail.de> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.101] (88.76.118.196) by AM0PR02CA0007.eurprd02.prod.outlook.com (2603:10a6:208:3e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24 via Frontend Transport; Mon, 26 Jul 2021 16:45:47 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 45 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 047e21a9-ba27-4e81-8140-08d95054d181 X-MS-TrafficTypeDiagnostic: DB8EUR06HT145: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TDgjSqof34TUPpdi3sKekywz6SzCwhEJKPE3jyoFnsSLKSFKMl+W1U/9xEz+SEYiZV5KHfJzYETnVRIGJsprJKiuhzdCtpp/cqSiZf2Kjf+buXsQWnYRUE8MVPfnAUlbcadKkhmQ0OyxxrawHTRV7eZtnJ4n2wW0u36B+29TLw5NmgD0QXZIuboIo4tVPjDZtH7QytMW2jFUKyxsTbHwtoybLmYOLwtaFxDW+Q/OZVy8pTzVj41MT+uTly8ekWKDA1WWhGRTMCxV1xJKTgcQ65XPiYtE8/wldqw/oixSHdUeMJzGYZZL474ctATu25KgLvocaeLxbq5kWrowuV4c9hIZjeCZgL/K3NtdqbjRPnRG4Ug27/JSdmNKGSmErH8gU8fSsiTOtzwxI+1y8Gu2ykHqFAJ4e5gGB3OtStzo5L+BKq2n03JIelK2saV93BPd X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tF8uTNlQZgtGQFjRKOzmI5BsQ67a5xvIfG1k+X6KtIO6wDCg6qw15Dl7MR54VV8Pag1C99l2cQxN3GD6NAhut+UFWGKleKAOUCMRMw7PB4lz/N9Mec0PfS9vXJU8YgJxCrOX7bRI0hT6cy7GAIp2Rg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 047e21a9-ba27-4e81-8140-08d95054d181 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2021 16:45:47.4624 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB8EUR06FT028.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8EUR06HT145 X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, FORGED_MUA_MOZILLA, FREEMAIL_FROM, GIT_PATCH_0, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_RPBL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" It was pointed out in PR101598 to be inappropriate, that ignored Ada decls receive the source line number which was recorded in the function decl's DECL_SOURCE_LOCATION. Therefore set all front-end-generated Ada decls with DECL_IGNORED_P to UNKNOWN_LOCATION. 2021-07-24 Bernd Edlinger PR debug/101598 * gcc-interface/trans.c (Subprogram_Body_to_gnu): Set the DECL_SOURCE_LOCATION of DECL_IGNORED_P gnu_subprog_decl to UNKNOWN_LOCATION. --- gcc/ada/gcc-interface/trans.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index f61183d..3df56aa 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -3885,7 +3885,9 @@ Subprogram_Body_to_gnu (Node_Id gnat_node) } /* Set the line number in the decl to correspond to that of the body. */ - if (!Sloc_to_locus (Sloc (gnat_node), &locus, false, gnu_subprog_decl)) + if (DECL_IGNORED_P (gnu_subprog_decl)) + locus = UNKNOWN_LOCATION; + else if (!Sloc_to_locus (Sloc (gnat_node), &locus, false, gnu_subprog_decl)) locus = input_location; DECL_SOURCE_LOCATION (gnu_subprog_decl) = locus;