From: Richard Biener Date: Tue, 20 Nov 2018 12:18:58 +0000 (+0000) Subject: re PR tree-optimization/88074 (g++ hangs on math expression) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c1d21cd17bce162e7afac5a1849d193952221ce8;p=gcc.git re PR tree-optimization/88074 (g++ hangs on math expression) 2018-11-20 Richard Biener PR tree-optimization/88074 * tree-ssa-dom.c (pass_dominator::execute): Do not walk backedges. * gcc.dg/pr88074.c: New testcase. From-SVN: r266313 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9cf7bb1be2e..45c7b750b75 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-11-20 Richard Biener + + PR tree-optimization/88074 + * tree-ssa-dom.c (pass_dominator::execute): Do not walk + backedges. + 2018-11-20 Richard Biener PR tree-optimization/88069 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 00475b8c5b9..32c0f3d6381 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-11-20 Richard Biener + + PR tree-optimization/88074 + * gcc.dg/pr88074.c: New testcase. + 2018-11-20 Martin Liska * 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 index 00000000000..9680fdd19f6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/pr88105.c @@ -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; +} diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index c50618dc809..7787da8b237 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -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;