From patchwork Thu Nov 18 17:58:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 47898 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 91613385C420 for ; Thu, 18 Nov 2021 17:58:44 +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 [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 02DB2385C420 for ; Thu, 18 Nov 2021 17:58:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 02DB2385C420 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass 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 EC86521155; Thu, 18 Nov 2021 17:58:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1637258294; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P1sDJyJnzY35GcXOyJMhrYLYSXK87RZNzoTUZO8HapY=; b=2pCExdd197M/91cQewC9GXJ2aL/64OdawMMjTzp0vhBb7KCL8saaHpP9g2filhr8x5onU7 qaOdNgmvs3UiivCIdozkYuB7nKnxRfI5GPSgL8PiNrU7iZlgJudoqb3fTA/bB9zUShFKa/ jhBxC0r3qUTUzY1Ze4EMIUWg5U6x6FI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1637258294; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P1sDJyJnzY35GcXOyJMhrYLYSXK87RZNzoTUZO8HapY=; b=jHrF+5WM09KsQksxysm1Tbz0wM8rayWHsbH1RXK2Tk7PrsL+0E3q3TORfDZ2phpy+aE7kq BI8hKTgoi+GTaLDQ== 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 CEF4413D76; Thu, 18 Nov 2021 17:58:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id D8B/MTaUlmHzYQAAMHmgww (envelope-from ); Thu, 18 Nov 2021 17:58:14 +0000 Message-ID: <3b0ef8c4-45df-1d84-158d-f6d98a493a32@suse.cz> Date: Thu, 18 Nov 2021 18:58:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] IPA: fix reproducibility in IPA MOD REF To: gcc-patches@gcc.gnu.org Content-Language: en-US X-Spam-Status: No, score=-11.6 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.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: , Cc: Jan Hubicka Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin gcc/ChangeLog: * ipa-modref.c (analyze_function): Do not execute the code only if dump_file != NULL. --- gcc/ipa-modref.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c index a3c7c6d6a1f..6cacf9c8ab1 100644 --- a/gcc/ipa-modref.c +++ b/gcc/ipa-modref.c @@ -2868,15 +2868,15 @@ analyze_function (function *f, bool ipa) optimization_summaries = modref_summaries::create_ggc (symtab); else /* Remove existing summary if we are re-running the pass. */ { - if (dump_file - && (summary - = optimization_summaries->get (fnode)) - != NULL + summary = optimization_summaries->get (fnode); + if (summary != NULL && summary->loads) { - fprintf (dump_file, "Past summary:\n"); - optimization_summaries->get - (fnode)->dump (dump_file); + if (dump_file) + { + fprintf (dump_file, "Past summary:\n"); + optimization_summaries->get (fnode)->dump (dump_file); + } past_flags.reserve_exact (summary->arg_flags.length ()); past_flags.splice (summary->arg_flags); past_retslot_flags = summary->retslot_flags;