re PR tree-optimization/89594 (ICE: Segmentation fault (in gsi_for_stmt(gimple*)))
authorRichard Biener <rguenther@suse.de>
Tue, 5 Mar 2019 14:57:12 +0000 (14:57 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 5 Mar 2019 14:57:12 +0000 (14:57 +0000)
2019-03-05  Richard Biener  <rguenther@suse.de>

PR tree-optimization/89594
* tree-if-conv.c (pass_if_conversion::execute): Handle
case where .LOOP_VECTORIZED_FUNCTION was removed.

* gcc.dg/pr89594.c: New testcase.

From-SVN: r269389

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr89594.c [new file with mode: 0644]
gcc/tree-if-conv.c

index 788ce54da7f982678e6829c1195760ff6c0b274f..4fb2792c70deeb326a3b2ef8ebad0a70a00ed0e4 100644 (file)
@@ -1,3 +1,9 @@
+2019-03-05  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/89594
+       * tree-if-conv.c (pass_if_conversion::execute): Handle
+       case where .LOOP_VECTORIZED_FUNCTION was removed.
+
 2019-03-05  Jakub Jelinek  <jakub@redhat.com>
 
        PR bootstrap/89560
index a019b6202be168a6f58d930fb42a57e3bb7e7472..529aa3cfd04da5c8e0b7c9e53c0ca28b11bdfd14 100644 (file)
@@ -1,3 +1,8 @@
+2019-03-05  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/89594
+       * gcc.dg/pr89594.c: New testcase.
+
 2019-03-05  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/89487
diff --git a/gcc/testsuite/gcc.dg/pr89594.c b/gcc/testsuite/gcc.dg/pr89594.c
new file mode 100644 (file)
index 0000000..4039f73
--- /dev/null
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-loop-if-convert -ftree-loop-vectorize -fno-tree-ch" } */
+
+int h3;
+
+void
+in (void)
+{
+  long int zr;
+  int ee = 0;
+
+  for (zr = 0; zr < 1; zr = h3)
+    {
+      ee = !!h3 ? zr : 0;
+
+      h3 = 0;
+      while (h3 < 0)
+       h3 = 0;
+    }
+
+  h3 = 0;
+  while (h3 < 1)
+    h3 = !!ee ? (!!h3 + 1) : 0;
+}
index fe3cc0214b4c823a1df0f851b4e55caef5bad0cd..ec2db007a6165fb1c905a59c35922afd0f73081b 100644 (file)
@@ -3176,6 +3176,8 @@ pass_if_conversion::execute (function *fun)
   for (unsigned i = 0; i < preds.length (); ++i)
     {
       gimple *g = preds[i];
+      if (!gimple_bb (g))
+       continue;
       unsigned ifcvt_loop = tree_to_uhwi (gimple_call_arg (g, 0));
       if (!get_loop (fun, ifcvt_loop))
        {