From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 666113858C30 for ; Wed, 8 Mar 2023 07:22:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 666113858C30 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id AC6191F383; Wed, 8 Mar 2023 07:22:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1678260131; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tUk/bfMgbUIpov47W18iEo+nXO1QfnDSeIob31YpaCE=; b=WOiuRH2RNhGKXBkovbnUzUzwWZ9t/NT/symtm8d4RI40FE5mZdUGBD/RT8fKz5uNjOnTJn dJaLO3qMW9k6HuUI0lHjQ4jaAokrvZh/pEBvhHyKBaaS1qweYXmDAEPmZXq1bGHWI6A1+B a9sjSt+OWzt12g+I/pRLa1wKqOLMkb0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1678260131; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tUk/bfMgbUIpov47W18iEo+nXO1QfnDSeIob31YpaCE=; b=/ZM6Vr64AmMPtn0hPZ3NkEYchPJNEoRZyujDXMwmUMkQkJ+bcQZmeoAjXPSuHHgnvwgUG6 DdltAWPeLHMCqrAg== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 828512C141; Wed, 8 Mar 2023 07:22:11 +0000 (UTC) Date: Wed, 8 Mar 2023 07:22:11 +0000 (UTC) From: Richard Biener To: Tamar Christina cc: gcc-patches@gcc.gnu.org, nd@arm.com, jlaw@ventanamicro.com Subject: Re: [PATCH]middle-end: On emergency dumps finish the graph generation. In-Reply-To: Message-ID: References: User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, 7 Mar 2023, Tamar Christina wrote: > 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? OK. > 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 > --- 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); > } > > > > > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman; HRB 36809 (AG Nuernberg)