From patchwork Tue Oct 3 17:08:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 1842758 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=u6Tfxe8M; dkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Orn29+Gf; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S0PRZ6Dn6z20Zh for ; Wed, 4 Oct 2023 04:08:42 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DC9EE38618F8 for ; Tue, 3 Oct 2023 17:08:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 70FD73856DF8 for ; Tue, 3 Oct 2023 17:08:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 70FD73856DF8 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id A922A21871 for ; Tue, 3 Oct 2023 17:08:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1696352908; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=3ZbYy6aV5IMPzjC6lPRSvVpGraC1IFtbfwKLL0xJ9nw=; b=u6Tfxe8MBU7ulxigi5koV5Alo9wC2Mc191Y2wQdHryruY4qNnj/4AeT3qfiT1TBG/sxZ40 66USmKaHkFN4eOQ5qAYdCSvR+Txfq8SxAEQS8ppjJCVKuXccwE3hi5/VQwSzNHD9gHzPL3 ZG1KglAqFq0ey/ZW/b/ccNop6RLgmxg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1696352908; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=3ZbYy6aV5IMPzjC6lPRSvVpGraC1IFtbfwKLL0xJ9nw=; b=Orn29+GfbTnpLFhJvqN8fC4q+Ybuiknl+CsoQ2PhRQII/J5YF8nM2SKpo0y9YsMgq+mii6 Rz+sa0yafDQg9lAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9E432132D4 for ; Tue, 3 Oct 2023 17:08:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id iSSdJoxKHGUoHgAAMHmgww (envelope-from ) for ; Tue, 03 Oct 2023 17:08:28 +0000 From: Martin Jambor To: GCC Patches Cc: Subject: [committed] ipa-modref: Fix dumping User-Agent: Notmuch/0.37 (https://notmuchmail.org) Emacs/29.1 (x86_64-suse-linux-gnu) Date: Tue, 03 Oct 2023 19:08:28 +0200 Message-ID: MIME-Version: 1.0 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_SOFTFAIL, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 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 Hi, function dump_lto_records ought to dump to its parameter OUT but was dumping expressions to dump_file. This is corrected by this patch and while at at, I also made the modref_summary::dump member function const so that it is callable from more contexts. I have committed this patch as obvious after including it in a bootstrap and testing on an x86_64-linux. Thanks, Martin gcc/ChangeLog: 2023-09-21 Martin Jambor * ipa-modref.h (modref_summary::dump): Make const. * ipa-modref.cc (modref_summary::dump): Likewise. (dump_lto_records): Dump to out instead of dump_file. --- gcc/ipa-modref.cc | 6 +++--- gcc/ipa-modref.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/ipa-modref.cc b/gcc/ipa-modref.cc index c04f9f44c06..fe55621f007 100644 --- a/gcc/ipa-modref.cc +++ b/gcc/ipa-modref.cc @@ -474,7 +474,7 @@ dump_lto_records (modref_records_lto *tt, FILE *out) FOR_EACH_VEC_SAFE_ELT (tt->bases, i, n) { fprintf (out, " Base %i:", (int)i); - print_generic_expr (dump_file, n->base); + print_generic_expr (out, n->base); fprintf (out, " (alias set %i)\n", n->base ? get_alias_set (n->base) : 0); if (n->every_ref) @@ -487,7 +487,7 @@ dump_lto_records (modref_records_lto *tt, FILE *out) FOR_EACH_VEC_SAFE_ELT (n->refs, j, r) { fprintf (out, " Ref %i:", (int)j); - print_generic_expr (dump_file, r->ref); + print_generic_expr (out, r->ref); fprintf (out, " (alias set %i)\n", r->ref ? get_alias_set (r->ref) : 0); if (r->every_access) @@ -567,7 +567,7 @@ remove_modref_edge_summaries (cgraph_node *node) /* Dump summary. */ void -modref_summary::dump (FILE *out) +modref_summary::dump (FILE *out) const { if (loads) { diff --git a/gcc/ipa-modref.h b/gcc/ipa-modref.h index 2a2d31e86db..f7dedace2da 100644 --- a/gcc/ipa-modref.h +++ b/gcc/ipa-modref.h @@ -66,7 +66,7 @@ struct GTY(()) modref_summary modref_summary (); ~modref_summary (); - void dump (FILE *); + void dump (FILE *) const; bool useful_p (int ecf_flags, bool check_flags = true); void finalize (tree); };