diff options
author | Richard Biener <rguenther@suse.de> | 2018-10-23 08:51:20 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2018-10-23 08:51:20 +0000 |
commit | a26eaf981dd83a9dc3ec7caa8d0350e1c760ee27 (patch) | |
tree | f1e37a9448d0b2430add75ba6cb78f68e05f1272 | |
parent | 2efade53fe39a9bd526997fb7cfe1d1d171a715d (diff) | |
download | gcc-a26eaf981dd83a9dc3ec7caa8d0350e1c760ee27.zip gcc-a26eaf981dd83a9dc3ec7caa8d0350e1c760ee27.tar.gz gcc-a26eaf981dd83a9dc3ec7caa8d0350e1c760ee27.tar.bz2 |
re PR tree-optimization/87693 (ICE in thread_around_empty_blocks, at tree-ssa-threadedge.c:984)
2018-10-23 Richard Biener <rguenther@suse.de>
PR tree-optimization/87693
* tree-ssa-threadedge.c (thread_around_empty_blocks): Handle
the case we do not find the taken edge.
* gcc.dg/torture/pr87693.c: New testcase.
From-SVN: r265413
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr87693.c | 17 | ||||
-rw-r--r-- | gcc/tree-ssa-threadedge.c | 3 |
4 files changed, 30 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0b7af4d..f50070d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-10-23 Richard Biener <rguenther@suse.de> + + PR tree-optimization/87693 + * tree-ssa-threadedge.c (thread_around_empty_blocks): Handle + the case we do not find the taken edge. + 2018-10-22 Paul Koning <ni1d@arrl.net> * symtab.c (symtab_node::increase_alignment): Correct max diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9441c26..204e41c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-10-23 Richard Biener <rguenther@suse.de> + + PR tree-optimization/87693 + * gcc.dg/torture/pr87693.c: New testcase. + 2018-10-23 Paul Thomas <pault@gcc.gnu.org> PR fortran/85603 diff --git a/gcc/testsuite/gcc.dg/torture/pr87693.c b/gcc/testsuite/gcc.dg/torture/pr87693.c new file mode 100644 index 0000000..802560d --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr87693.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ + +void f (void); +void g (void); +void h (int a) +{ + void *p, **q; + if (a) + p = (void *)f; + else + p = (void *)g; + q = (void *)p; + if (*q == (void *)0) + goto *p; +L0: + return; +} diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c index 0b1f973..330ba15 100644 --- a/gcc/tree-ssa-threadedge.c +++ b/gcc/tree-ssa-threadedge.c @@ -981,7 +981,8 @@ thread_around_empty_blocks (edge taken_edge, else taken_edge = find_taken_edge (bb, cond); - if ((taken_edge->flags & EDGE_DFS_BACK) != 0) + if (!taken_edge + || (taken_edge->flags & EDGE_DFS_BACK) != 0) return false; if (bitmap_bit_p (visited, taken_edge->dest->index)) |