From patchwork Fri Nov 26 07:53:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 48178 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 1409F385841E for ; Fri, 26 Nov 2021 07:53:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1409F385841E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1637913215; bh=DN26NFzWchuUKzHuhMR96j6mRLp6UmUGAYvmsX2okm8=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=DdDrG8r2l+s12r0GNHiBAPBr8rODEW+uiJB6AAzHgBGGbw99ROmYsw5p7mC4r1qkg B/CbwwKla1JYnAsU1v7uDuurAbypJvZHPySp92KSyiKp4btD+8tTmEzxtoaHEFWXpB sJr5oNphKDLfo12GQ5LprZ/8aYMGLA/TVnCjv6zc= 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 3330B3858D39 for ; Fri, 26 Nov 2021 07:53:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3330B3858D39 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 961D221923; Fri, 26 Nov 2021 07:53:03 +0000 (UTC) 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 77AD813C09; Fri, 26 Nov 2021 07:53:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id rNGPG1+SoGFoFAAAMHmgww (envelope-from ); Fri, 26 Nov 2021 07:53:03 +0000 Date: Fri, 26 Nov 2021 08:53:03 +0100 (CET) To: gcc-patches@gcc.gnu.org Subject: [PATCH] Restore can_be_invalidated_p semantics to before refactoring Message-ID: <37545rsn-6682-46p8-8986-7o7q6576n1sr@fhfr.qr> MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 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: , X-Patchwork-Original-From: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Cc: msebor@redhat.com Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" This restores the semantics of can_be_invalidated_p to the original semantics of the function this was split out from tree-ssa-uninit.c. The current semantics only ever look at the first predicate which cannot be correct. Bootstrapped and tested on x86_64-unknown-linux-gnu, OK? Thanks, Richard. 2021-11-26 Richard Biener * gimple-predicate-analysis.cc (can_be_invalidated_p): Restore semantics to the one before the split from tree-ssa-uninit.c. --- gcc/gimple-predicate-analysis.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gcc/gimple-predicate-analysis.cc b/gcc/gimple-predicate-analysis.cc index 6dde0203841..da6adc9a3e2 100644 --- a/gcc/gimple-predicate-analysis.cc +++ b/gcc/gimple-predicate-analysis.cc @@ -1199,14 +1199,16 @@ can_be_invalidated_p (const pred_chain_union &preds, const pred_chain &guard) for (unsigned i = 0; i < preds.length (); ++i) { const pred_chain &chain = preds[i]; - for (unsigned j = 0; j < chain.length (); ++j) + unsigned j; + for (j = 0; j < chain.length (); ++j) if (can_be_invalidated_p (chain[j], guard)) - return true; + break; /* If we were unable to invalidate any predicate in C, then there is a viable path from entry to the PHI where the PHI takes an interesting value and continues to a use of the PHI. */ - return false; + if (j == chain.length ()) + return false; } return true; }