From patchwork Tue Mar 7 17:38:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 1753417 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=Qqa784Ma; dkim-atps=neutral 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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PWN3d6pPNz1yXD for ; Wed, 8 Mar 2023 04:39:09 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EB524385B528 for ; Tue, 7 Mar 2023 17:39:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EB524385B528 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678210748; bh=GLMTWZGAkKnRp0TPK0vVg0m1/vY/ig1NXhbgjs3CuiY=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Qqa784Maj/vrlQtqjeOISmVuZ0JpSg4N5SyJZ6asL86v5CudLh4lPyh+q+JdefFe0 FReqJPNiCt+M2uBXsIGSJH+iqoH9EEgkQGHk54PH5U3J3MIA8HsJ448/YdFQief1S0 3OvZx6RxP57nQ5qnN682xNUMmih6jFHI2Mey7ycQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2072.outbound.protection.outlook.com [40.107.249.72]) by sourceware.org (Postfix) with ESMTPS id 4C9643858C20 for ; Tue, 7 Mar 2023 17:38:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4C9643858C20 Received: from FR3P281CA0024.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::15) by DU0PR08MB8494.eurprd08.prod.outlook.com (2603:10a6:10:405::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Tue, 7 Mar 2023 17:38:41 +0000 Received: from VI1EUR03FT012.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:1c:cafe::f4) by FR3P281CA0024.outlook.office365.com (2603:10a6:d10:1c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.16 via Frontend Transport; Tue, 7 Mar 2023 17:38:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VI1EUR03FT012.mail.protection.outlook.com (100.127.145.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29 via Frontend Transport; Tue, 7 Mar 2023 17:38:41 +0000 Received: ("Tessian outbound cfb430c87a1e:v135"); Tue, 07 Mar 2023 17:38:41 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2bb4c9c01c0bea9c X-CR-MTA-TID: 64aa7808 Received: from ddb765e8df42.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9A96DEE9-7152-48DE-9DD7-717C462689ED.1; Tue, 07 Mar 2023 17:38:34 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ddb765e8df42.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 07 Mar 2023 17:38:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kX/u22NrdavZ+Tbq7nWe7tQT0oIO7ohWB7deyaKAi8q3biy1c2SgnqIA32Rt0TuuK7N9An7O55uM92KVtrvISsIzp6vPJNgOC1gJxcrTJ4wZin66IK7+QEDJQBERx90L9V61GmEBUcr2gIdH9c/52I8T2CWir66psZdo4C3ykuSB6t7VuRNSa3/MRmcodL6aiAXH27OT4U19cSMI/qdG8vkEBN/IhKzY8bQZOBOXa/pwG4S/jQPBOM+/Nfsb0nCTqyFtzRxwtia8USr8eD49GF6VwtdvOPvjMTl5vT87lq0nt9bn5YIC84HuMFQfVbFoK9rPfmOkQ2FeDhndXjTi+g== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GLMTWZGAkKnRp0TPK0vVg0m1/vY/ig1NXhbgjs3CuiY=; b=lU40gLblrfJBiE9NshtUhyjNZIkazJ+NcHQTAoIaq4Z49c8LBEIMVaLRtc3PJljQTExfGRHpy6WCH+PhySJmdeZKVYHbIcsYXSuBSHShMY/Hpv+bmJZpwqBKyVuJTJoV0msT4xjZ6UnQNx2VGLY/oUaOs3S7QU3s81J1KGEXp6YouSuC2n2lRqI7YPbGpv+FV9LDbr0WOtmBfQK/8zuTk59BJ8y3YSus0RqA54bqi/4oF3kkLLpieDDT8+NVzXTI3fIdJkxE0tQ1G2DGWI9NYmXiPpMhNFUvb8yX7mpxnGefhgbtEFbuqP95GdeuWTB1vRdsnmwoGKElCxse/RtQuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by GV2PR08MB8317.eurprd08.prod.outlook.com (2603:10a6:150:b5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29; Tue, 7 Mar 2023 17:38:31 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::210c:d369:23f7:84fe]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::210c:d369:23f7:84fe%9]) with mapi id 15.20.6156.029; Tue, 7 Mar 2023 17:38:31 +0000 Date: Tue, 7 Mar 2023 17:38:29 +0000 To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, rguenther@suse.de, jlaw@ventanamicro.com Subject: [PATCH]middle-end: On emergency dumps finish the graph generation. Message-ID: Content-Disposition: inline X-ClientProxiedBy: LO4P123CA0346.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18d::9) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|GV2PR08MB8317:EE_|VI1EUR03FT012:EE_|DU0PR08MB8494:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a093b95-1bf6-47d6-6119-08db1f32cadc x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 6xMN4mMHIh7CGUVawxhJpu8H68wE3EAfwaNsWGa1SgLMU/m1vuhMcIV0LvS4EL0q1XWPqPgIG4REY6rZu6OI/T792c689r/lzmhd33IhO/2iB6wo3QIKorygCZb1upBusPknydGSzDloIVMmPLhiq7pnu0+n808bH+cUgO90HZEud+o3srUhjDhEICoQNME6BuH2g/sY5LdNX5fqRcTJaaqoJZmvOFLs6KxtlHikhRUxQ2DlBtgiXm15hgnOT9UZBwG97uZhN5w4dGi0qIeRDSntqQMMpGKXuRUxWxuIJH6BCaRV7OCDUAj9t35rgkAWqxOs/pk3xgc0Z47roGvwyGVb5QT6Gug9H2kXkTUKncNTshIJ8i/KFjZSF/p5YN3D8EjJX5fjOIgZa1+DI+v4NyMQivyWiYYOfBDUHhEaKt3Y6ZzGB4bxtD+G5QnLveYSvF3YRpzyYophEAEYUKeTLCJxcNN7CSOJpb4Mpf7sDW9hUMJkSLJJd2G1idhrbQ1jIKfPy9liNdMIgG+KkHykgCXIX5PRXef3Tugs1C9jJ6+LzJPO8Ob+2kyefS01214CbNyIOz4MP3mXMyAjnbUGE5oBHxLxjxp15M0DZpNJ9RnhPm8BqgIhUTgkFCbhSw5aN4ew7DTRPDQ66yfXKT9lfBr3Cw7mNZ3NA/iDaAygQz/ufMqkK0clgxdnhAkhL5XPpT13DvrTE8jxercf7ynxAbou4RCRXO1e9SdAQdk8Mkg= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB5325.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(346002)(366004)(376002)(136003)(396003)(39860400002)(451199018)(2906002)(44832011)(8936002)(5660300002)(235185007)(66946007)(41300700001)(6916009)(66476007)(8676002)(66556008)(4326008)(6486002)(36756003)(316002)(478600001)(86362001)(26005)(186003)(4743002)(2616005)(6512007)(33964004)(44144004)(6506007)(83380400001)(38100700002)(4216001)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8317 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT012.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 22ece484-73fc-445c-2009-08db1f32c4e2 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0Gzg6tPr3hcsgaSJ5mCIU4EEW92VBxKje8yOvorJOpDbk1r1vM28+qe55w21dSVdoX62ykIPt6JTX5DoBMaReX+qRn9bBlnKIT4r7nUdKH2zSoe/PRPHVt55p/Dl+761IDxeP6vkUxsdcqJcn6wnagm4oVlkUBSaa6YoqxbiaD2NsskH9j7ToNhbhrgDJmmZppQaPDYGpbLuPi7fUBZ0kjUN+ksG/nbCIIeqcTdKwk4Mp8jr+Gkr2FvXjFRgiRUo5EQa4QFuvc69bV8sMJNT+Iqtkkf3yfy2x9NueGLl7v56bfACZS06iuqMYw3FH7CeaUdCqJHlwffT5aRE+Jk+XXGeY3tx+HJzJpliGl7/L1SFLzHxfvsrlV9+EZfe8ycNlpWRzkcRg1Q74WMD1b+HdrCg6RV5KiSQ7nRC8Sqq0iKo4mms41tu80kOcEU0uS1LUiPn9mUKcjD1tlcmZdseg6vLBH3GM4a8wuNq/O8U3X036RQeLjuGXciVjm7w2BCPDQMTF7qwtRmiw4pR2DEVE4pTDwCe7geB8p43oL5iK2REvLDxBAxC55Gex8Jun/I+xE1j04+7HAdXylyfhGvPQzpmvaAzYsuQdo28Jcrca0exz2VugZ2XqGF1uZGzuew/jOmEr6B/zY8Yoe+ZFW98OCb3r25j5GXuCmJlXK3jHUrJa3QG154wv/ExFshu9qj9KKOk196fbOwsyrJbgeGVtzM/bc3l/ma+xc4JMAjW+vJeqJZSIAei6HiT9t9OoVjh X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230025)(4636009)(376002)(136003)(396003)(346002)(39860400002)(451199018)(46966006)(36840700001)(40470700004)(356005)(36860700001)(81166007)(86362001)(82740400003)(2906002)(36756003)(70586007)(4326008)(44832011)(235185007)(5660300002)(6916009)(41300700001)(70206006)(8676002)(8936002)(40480700001)(82310400005)(6506007)(336012)(26005)(2616005)(40460700003)(44144004)(47076005)(4743002)(33964004)(186003)(83380400001)(6512007)(316002)(478600001)(6486002)(107886003)(4216001)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 17:38:41.4229 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9a093b95-1bf6-47d6-6119-08db1f32cadc X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR03FT012.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8494 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: , X-Patchwork-Original-From: Tamar Christina via Gcc-patches From: Tamar Christina Reply-To: Tamar Christina Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi All, When doing an emergency dump the cfg output dumps are corrupted because the ending "}" is missing. Normally when the pass manager finishes it would call finish_graph_dump_file to produce this. This is called here because each pass can dump multiple digraphs. However during an emergency dump we only dump the current function and so after that is done we never go back to the pass manager. As such, we need to manually call finish_graph_dump_file in order to properly finish off graph generation. With this -ftree-dump-*-graph works properly during a crash dump. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: * passes.cc (emergency_dump_function): Finish graph generation. --- inline copy of patch -- diff --git a/gcc/passes.cc b/gcc/passes.cc index 347214e81d0cfac05d9ba782db0eda1cdd7e9c87..38642a4010941b414a1ed1fd70a348778addbf60 100644 --- diff --git a/gcc/passes.cc b/gcc/passes.cc index 347214e81d0cfac05d9ba782db0eda1cdd7e9c87..38642a4010941b414a1ed1fd70a348778addbf60 100644 --- a/gcc/passes.cc +++ b/gcc/passes.cc @@ -1845,6 +1845,13 @@ emergency_dump_function () fprintf (dump_file, "\n\n\nEMERGENCY DUMP:\n\n"); execute_function_dump (cfun, current_pass); + /* Normally the passmanager will close the graphs as a pass could be wanting + to print multiple digraphs. But during an emergency dump there can only be + one and we must finish the graph manually. */ + if ((cfun->curr_properties & PROP_cfg) + && (dump_flags & TDF_GRAPH)) + finish_graph_dump_file (dump_file_name); + if (symtab && current_pass->type == IPA_PASS) symtab->dump (dump_file); } --- a/gcc/passes.cc +++ b/gcc/passes.cc @@ -1845,6 +1845,13 @@ emergency_dump_function () fprintf (dump_file, "\n\n\nEMERGENCY DUMP:\n\n"); execute_function_dump (cfun, current_pass); + /* Normally the passmanager will close the graphs as a pass could be wanting + to print multiple digraphs. But during an emergency dump there can only be + one and we must finish the graph manually. */ + if ((cfun->curr_properties & PROP_cfg) + && (dump_flags & TDF_GRAPH)) + finish_graph_dump_file (dump_file_name); + if (symtab && current_pass->type == IPA_PASS) symtab->dump (dump_file); }