public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Restore can_be_invalidated_p semantics to before refactoring
@ 2021-11-26  7:53 Richard Biener
  2021-11-28 19:21 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Biener @ 2021-11-26  7:53 UTC (permalink / raw)
  To: gcc-patches; +Cc: msebor

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  <rguenther@suse.de>

	* 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;
 }
-- 
2.31.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Restore can_be_invalidated_p semantics to before refactoring
  2021-11-26  7:53 [PATCH] Restore can_be_invalidated_p semantics to before refactoring Richard Biener
@ 2021-11-28 19:21 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2021-11-28 19:21 UTC (permalink / raw)
  To: Richard Biener, gcc-patches; +Cc: msebor



On 11/26/2021 12:53 AM, Richard Biener via Gcc-patches wrote:
> 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  <rguenther@suse.de>
>
> 	* gimple-predicate-analysis.cc (can_be_invalidated_p):
> 	Restore semantics to the one before the split from
> 	tree-ssa-uninit.c.
OK.  Sorry this got missed in the review of splitting out those bits.

jeff


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-28 19:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-26  7:53 [PATCH] Restore can_be_invalidated_p semantics to before refactoring Richard Biener
2021-11-28 19:21 ` Jeff Law

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).