From patchwork Tue Dec 1 19:20:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Edlinger X-Patchwork-Id: 1409001 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=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=hotmail.de Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4ClsQG6Nz2z9sPB for ; Wed, 2 Dec 2020 06:20:53 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A0924388A40E; Tue, 1 Dec 2020 19:20:49 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-oln040092071010.outbound.protection.outlook.com [40.92.71.10]) by sourceware.org (Postfix) with ESMTPS id 03BA63857C4F for ; Tue, 1 Dec 2020 19:20:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 03BA63857C4F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=hotmail.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bernd.edlinger@hotmail.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=grT3O3CTRRzhLUECNckU1tCIkVP26Wbaq9g6EzaeX3guN0gtBxOfYoxrIHKlNd3HSS9OvFNAJh6xV1MEZ4d5Xqbt6D7Kp9WMTihkhMxXv/Lm8MWwFSk9j1iKhW8wjuBX/+jjvUrP4ijZFiFhjuBJDHLt5jA0JpDBWRr2SShnqddPN8MST58615mEr8DmtQeOR98yRfQubjgYBX8xF/8+9fTzrhZae+uXHSz6LipYSksADELRX5ZsjJEQyjS4qGuI+DuoNDDgvhc7YCj2YtJTRCETWbU2ME/i6+8Qo99EeJ5jMR41v6HBkZHM58vOYL2KEBV768i1vwBiITi2LsqTzQ== 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=PmEE/devJ0XWz9SvvhWjS8mzZuuaYvOPakmyy1O4bXU=; b=MHljyis5k5wEsBFKeKJrTDiOrokTGME/iYHIkV6W96kIFUxWawhax3btvBQ5Pxh97tjWEs/D1alWA/cOa37hXtGx3bx/jmVu9oDVWV9/VypcHhNrZWcAfTkl3lBckLpOxMh6W24DYDPAUkjzwoJjKb0wH5wPOLyM75cvreQzH2Pi2bGYYV7XE51drg7JXJy4RDO/EPNXCMJOLBoBxqD6zvfcieNKqvXmcVt5H54ksj8WqWkD+594b3Cbz+Px0/fxUSI26paJ1T5wsQ8d/+eCqhx2YU9IpzIrV2akmTHUDTK19gt1kewaWjiZBpTiReofq5YjM6qUAxoZ44oQLQVqjA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from DB5EUR03FT022.eop-EUR03.prod.protection.outlook.com (2a01:111:e400:7e0a::46) by DB5EUR03HT118.eop-EUR03.prod.protection.outlook.com (2a01:111:e400:7e0a::394) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.26; Tue, 1 Dec 2020 19:20:45 +0000 Received: from AM6PR03MB5170.eurprd03.prod.outlook.com (2a01:111:e400:7e0a::45) by DB5EUR03FT022.mail.protection.outlook.com (2a01:111:e400:7e0a::171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.26 via Frontend Transport; Tue, 1 Dec 2020 19:20:45 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:5FAF771F206C757E3F0EE89667DDCA31541BE707645BA0948593CC9B424FEA31; UpperCasedChecksum:7CD7878031F273B8442C6661A0450E75123ACEA5738586A714E61C5DC7876F2E; SizeAsReceived:7765; Count:44 Received: from AM6PR03MB5170.eurprd03.prod.outlook.com ([fe80::184e:5e8c:db8f:a596]) by AM6PR03MB5170.eurprd03.prod.outlook.com ([fe80::184e:5e8c:db8f:a596%5]) with mapi id 15.20.3611.031; Tue, 1 Dec 2020 19:20:45 +0000 To: "gcc-patches@gcc.gnu.org" , Richard Biener , Jeff Law , Alexandre Oliva , Jason Merrill From: Bernd Edlinger Subject: [PATCH] Remove misleading debug line entries Message-ID: Date: Tue, 1 Dec 2020 20:20:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 Content-Language: en-US X-TMN: [lV0dJiqRGqxQ7LWvy4lXoNmhy2AW/TiX] X-ClientProxiedBy: AM4PR05CA0004.eurprd05.prod.outlook.com (2603:10a6:205::17) To AM6PR03MB5170.eurprd03.prod.outlook.com (2603:10a6:20b:ca::23) X-Microsoft-Original-Message-ID: <5e0fbaed-eb68-f4ea-6c5b-a61e7d9e27eb@hotmail.de> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.101] (84.57.57.184) by AM4PR05CA0004.eurprd05.prod.outlook.com (2603:10a6:205::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17 via Frontend Transport; Tue, 1 Dec 2020 19:20:45 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 44 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 2e28c735-e647-478d-b988-08d8962e33b4 X-MS-TrafficTypeDiagnostic: DB5EUR03HT118: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MpP++3SdiqX12fWMWgnpgcK+fHqzRBLg+MHtAtkJU6qXN8Vfi//EHk1EvN2x+V4QXoKRjA1XDmGvu6zqu2zknVKslcMwbtZ3z8H6jDgUXrZ9si8J19CMk9oyazrwgeair+1h2g6r09th9qBsLeUi53s26wEPOICogdZGhzDxB475Ls4ZjRETSNJG4aVko8X5C3v/63HDm41qjWswsWdYbw== X-MS-Exchange-AntiSpam-MessageData: rPvNl5bShWQmASkX70ceEUbmyDkHCbSOib2tdooLh6JRBALYMwhLjU4Zudox3Pz3xj6h/MNqfYV9tylo6St1r8d0pjhVUlfgYkTZ2fhINWkGJNEprJ8TssTGOc7H9AnHVEJqjuBHuYPfLIWUCH73WA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e28c735-e647-478d-b988-08d8962e33b4 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2020 19:20:45.6727 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT022.eop-EUR03.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: DB5EUR03HT118 X-Spam-Status: No, score=-7.7 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_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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@gcc.gnu.org Sender: "Gcc-patches" Hi! This removes gimple_debug stmts without block info after a NULL INLINE_ENTRY. The line numbers from these stmts are from the inline function, but since the inline function is completely optimized away, there will be no DW_TAG_inlined_subroutine so the debugger has no callstack available at this point, and therefore those line table entries are not helpful to the user. 2020-11-20 Bernd Edlinger * cfgexpand.c (expand_gimple_basic_block): Remove debug_begin_stmts following a removed debug_inline_entry. Bootstrapped and reg-tested on x86_64-pc-linux-gnu. Is it OK for trunk? Thanks Bernd. From 464867ca9b4cc6270fb6d41dc5346dc55395efb0 Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Fri, 13 Nov 2020 16:26:28 +0100 Subject: [PATCH] Remove misleading debug line entries This removes gimple_debug stmts without block info after a NULL INLINE_ENTRY. The line numbers from these stmts are from the inline function, but since the inline function is completely optimized away, there will be no DW_TAG_inlined_subroutine so the debugger has no callstack available at this point, and therefore those line table entries are not helpful to the user. 2020-11-20 Bernd Edlinger * cfgexpand.c (expand_gimple_basic_block): Remove debug_begin_stmts following a removed debug_inline_entry. --- gcc/cfgexpand.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 1df6f4b..6bd38ac 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -5785,6 +5785,7 @@ expand_gimple_basic_block (basic_block bb, bool disable_tail_calls) tree value = NULL_TREE; rtx val = NULL_RTX; machine_mode mode; + bool skip_inline_loc = false; if (!gimple_debug_nonbind_marker_p (stmt)) { @@ -5837,7 +5838,10 @@ expand_gimple_basic_block (basic_block bb, bool disable_tail_calls) if (block) val = GEN_RTX_DEBUG_MARKER_INLINE_ENTRY_PAT (); else - goto delink_debug_stmt; + { + skip_inline_loc = true; + goto delink_debug_stmt; + } } else gcc_unreachable (); @@ -5877,6 +5881,8 @@ expand_gimple_basic_block (basic_block bb, bool disable_tail_calls) stmt = gsi_stmt (nsi); if (!is_gimple_debug (stmt)) break; + if (skip_inline_loc && !gimple_block (stmt)) + goto delink_debug_stmt; } set_curr_insn_location (sloc); -- 1.9.1