public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Richard Biener <rguenth@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-5571] Restore can_be_invalidated_p semantics to before refactoring
Date: Mon, 29 Nov 2021 08:20:20 +0000 (GMT)	[thread overview]
Message-ID: <20211129082020.6174C3885C16@sourceware.org> (raw)

https://gcc.gnu.org/g:5e5f880d0452ef2cffb94f4a686d56833c9f4215

commit r12-5571-g5e5f880d0452ef2cffb94f4a686d56833c9f4215
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Nov 26 08:50:24 2021 +0100

    Restore can_be_invalidated_p semantics to before refactoring
    
    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.
    
    2021-11-26  Richard Biener  <rguenther@suse.de>
    
            * gimple-predicate-analysis.cc (can_be_invalidated_p):
            Restore semantics to the one before the split from
            tree-ssa-uninit.c.

Diff:
---
 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;
 }


                 reply	other threads:[~2021-11-29  8:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211129082020.6174C3885C16@sourceware.org \
    --to=rguenth@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).