re PR tree-optimization/88074 (g++ hangs on math expression)
authorRichard Biener <rguenther@suse.de>
Tue, 20 Nov 2018 12:18:58 +0000 (12:18 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 20 Nov 2018 12:18:58 +0000 (12:18 +0000)
2018-11-20  Richard Biener  <rguenther@suse.de>

PR tree-optimization/88074
* tree-ssa-dom.c (pass_dominator::execute): Do not walk
backedges.

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

From-SVN: r266313

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/gomp/pr88105.c [new file with mode: 0644]
gcc/tree-ssa-dom.c

index 9cf7bb1be2e06f83c11d9f00edd358ea96761e10..45c7b750b757f95981572b49b9238787b5362553 100644 (file)
@@ -1,3 +1,9 @@
+2018-11-20  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/88074
+       * tree-ssa-dom.c (pass_dominator::execute): Do not walk
+       backedges.
+
 2018-11-20  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/88069
index 00475b8c5b959686f7748d1a7a50792f886603e2..32c0f3d638107dcd2236b15fcb419a31b7542f3e 100644 (file)
@@ -1,3 +1,8 @@
+2018-11-20  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/88074
+       * gcc.dg/pr88074.c: New testcase.
+
 2018-11-20  Martin Liska  <mliska@suse.cz>
 
        * pr57362.C: Move to g++.target/i386 folder.
diff --git a/gcc/testsuite/gcc.dg/gomp/pr88105.c b/gcc/testsuite/gcc.dg/gomp/pr88105.c
new file mode 100644 (file)
index 0000000..9680fdd
--- /dev/null
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -O -fexceptions -fnon-call-exceptions -fno-tree-fre" } */
+
+int
+s0 (void)
+{
+  int g6, oh = 0;
+  int *a6 = &g6;
+
+  (void) a6;
+
+#pragma omp parallel for
+  for (g6 = 0; g6 < 1; ++g6)
+    {
+      int zk;
+
+      for (zk = 0; zk < 1; ++zk)
+        {
+          oh += zk / (zk + 1);
+
+          for (;;)
+            {
+            }
+        }
+
+      a6 = &zk;
+    }
+
+  return oh;
+}
index c50618dc8097cc9bb6e3a658fcbc918a621d9cb5..7787da8b237bf829f27163b8b207638e01feae59 100644 (file)
@@ -777,7 +777,8 @@ pass_dominator::execute (function *fun)
          if (bb == NULL)
            continue;
          while (single_succ_p (bb)
-                && (single_succ_edge (bb)->flags & EDGE_EH) == 0)
+                && (single_succ_edge (bb)->flags
+                    & (EDGE_EH|EDGE_DFS_BACK)) == 0)
            bb = single_succ (bb);
          if (bb == EXIT_BLOCK_PTR_FOR_FN (fun))
            continue;