revert: [multiple changes]
authorRichard Biener <rguenther@suse.de>
Mon, 30 Oct 2017 12:45:53 +0000 (12:45 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 30 Oct 2017 12:45:53 +0000 (12:45 +0000)
2017-10-30  Richard Biener  <rguenther@suse.de>

PR tree-optimization/82762
Revert
2017-10-23  Richard Biener  <rguenther@suse.de>

PR tree-optimization/82129
Revert
2017-08-01  Richard Biener  <rguenther@suse.de>

PR tree-optimization/81181
* tree-ssa-pre.c (compute_antic_aux): Defer clean() to ...
(compute_antic): ... end of iteration here.

* gcc.dg/torture/pr82762.c: New testcase.

From-SVN: r254218

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr82762.c [new file with mode: 0644]
gcc/tree-ssa-pre.c

index 0274d9b..5468ee6 100644 (file)
@@ -1,3 +1,17 @@
+2017-10-30  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/82762
+       Revert
+       2017-10-23  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/82129
+       Revert
+       2017-08-01  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/81181
+       * tree-ssa-pre.c (compute_antic_aux): Defer clean() to ...
+       (compute_antic): ... end of iteration here.
+
 2017-10-30  Joseph Myers  <joseph@codesourcery.com>
 
        * doc/invoke.texi (C Dialect Options): Document -std=c17,
index 598e4c0..a5cb0ca 100644 (file)
@@ -1,5 +1,10 @@
 2017-10-30  Richard Biener  <rguenther@suse.de>
 
+       PR tree-optimization/82762
+       * gcc.dg/torture/pr82762.c: New testcase.
+
+2017-10-30  Richard Biener  <rguenther@suse.de>
+
        * gcc.dg/gimplefe-27.c: New testcase.
 
 2017-10-30  Joseph Myers  <joseph@codesourcery.com>
diff --git a/gcc/testsuite/gcc.dg/torture/pr82762.c b/gcc/testsuite/gcc.dg/torture/pr82762.c
new file mode 100644 (file)
index 0000000..d4f57bc
--- /dev/null
@@ -0,0 +1,46 @@
+/* { dg-do compile } */
+
+int printf (const char *, ...);
+
+int b, c, d, e, f, g, j, k;
+char h, i;
+volatile int l;
+
+int m (int n, int o)
+{ 
+  return o < 0 || o > 1 ? n : o;
+}
+
+int p (int n, unsigned o)
+{ 
+  return n - o;
+}
+
+int q ()
+{ 
+  char r;
+  int a, s, t, u, v, w;
+L:
+  if (t)
+    printf ("%d", d);
+  u = v;
+  while (j)
+    { 
+      while (e)
+       for (w = 0; w != 54; w += 6)
+         { 
+           l;
+           s = p (u < 1, i || c);
+           r = s < 0 || s > 1 ? 0 : 1 >> s;
+           v = r;
+           g = h;
+         }
+      if (h)
+       return f;
+      if (u)
+       for (a = 0; a != 54; a += 6)
+         f = m (2, -(k || b));
+    }
+  d = t;
+  goto L;
+}
index e4189d1..281f100 100644 (file)
@@ -2029,7 +2029,8 @@ static sbitmap has_abnormal_preds;
      ANTIC_OUT[BLOCK] = phi_translate (ANTIC_IN[succ(BLOCK)])
 
    ANTIC_IN[BLOCK] = clean(ANTIC_OUT[BLOCK] U EXP_GEN[BLOCK] - TMP_GEN[BLOCK])
-*/
+
+   Note that clean() is deferred until after the iteration.  */
 
 static bool
 compute_antic_aux (basic_block block, bool block_has_abnormal_pred_edge)
@@ -2165,7 +2166,8 @@ compute_antic_aux (basic_block block, bool block_has_abnormal_pred_edge)
     bitmap_value_insert_into_set (ANTIC_IN (block),
                                  expression_for_id (bii));
 
-  clean (ANTIC_IN (block));
+  /* clean (ANTIC_IN (block)) is defered to after the iteration converged
+     because it can cause non-convergence, see for example PR81181.  */
 
   if (!bitmap_set_equal (old, ANTIC_IN (block)))
     changed = true;
@@ -2397,6 +2399,12 @@ compute_antic (void)
       gcc_checking_assert (num_iterations < 500);
     }
 
+  /* We have to clean after the dataflow problem converged as cleaning
+     can cause non-convergence because it is based on expressions
+     rather than values.  */
+  FOR_EACH_BB_FN (block, cfun)
+    clean (ANTIC_IN (block));
+
   statistics_histogram_event (cfun, "compute_antic iterations",
                              num_iterations);