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 r13-2493] tree-optimization/106844 - fix ICE in init_use_preds
Date: Tue,  6 Sep 2022 09:29:09 +0000 (GMT)	[thread overview]
Message-ID: <20220906092909.07B8938515C2@sourceware.org> (raw)

https://gcc.gnu.org/g:1a4e1425f8498580994e32ceb3c50bd52616a82d

commit r13-2493-g1a4e1425f8498580994e32ceb3c50bd52616a82d
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Sep 6 10:42:50 2022 +0200

    tree-optimization/106844 - fix ICE in init_use_preds
    
    The following fixes an oversight in the last change to
    compute_control_dep_chain where we have to return whether we found
    a chain.
    
            PR tree-optimization/106844
            * gimple-predicate-analysis.cc (compute_control_dep_chain):
            Return whether we found a chain.
    
            * gcc.dg/pr106844.c: New testcase.

Diff:
---
 gcc/gimple-predicate-analysis.cc |  2 +-
 gcc/testsuite/gcc.dg/pr106844.c  | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/gcc/gimple-predicate-analysis.cc b/gcc/gimple-predicate-analysis.cc
index 681047deee7..ef2906ebc51 100644
--- a/gcc/gimple-predicate-analysis.cc
+++ b/gcc/gimple-predicate-analysis.cc
@@ -1077,7 +1077,7 @@ compute_control_dep_chain (basic_block dom_bb, const_basic_block dep_bb,
 	      if (dump_file)
 		fprintf (dump_file, "param_uninit_control_dep_attempts "
 			 "exceeded: %u\n", *num_calls);
-	      return false;
+	      break;
 	    }
 	  ++*num_calls;
 
diff --git a/gcc/testsuite/gcc.dg/pr106844.c b/gcc/testsuite/gcc.dg/pr106844.c
new file mode 100644
index 00000000000..df68d76f257
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr106844.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized --param uninit-control-dep-attempts=1" } */
+
+struct {
+  int count;
+  int array[8];
+} fde_merge_v1;
+
+void
+fde_merge_i2() {
+  unsigned i1;
+  do
+    while (i1 && fde_merge_v1.array[i1 - 1]) /* { dg-warning "uninitialized" } */
+      i1--;
+  while (fde_merge_i2);
+}

                 reply	other threads:[~2022-09-06  9:29 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=20220906092909.07B8938515C2@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).