From 7b3ca2443530663016432f3b6515e408ce35ba64 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 28 Aug 2018 10:13:18 +0000 Subject: [PATCH] re PR tree-optimization/87117 (ICE in eliminate_dom_walker::eliminate_cleanup(bool) at gcc/gcc/tree-ssa-sccvn.c:5431 since r263875) 2018-08-28 Richard Biener PR tree-optimization/87117 * tree-ssa-pre.c (compute_avail): Do not make expressions with predicated values available. (get_expr_value_id): Assert we do not run into predicated value expressions. * gcc.dg/pr87117-2.c: New testcase. From-SVN: r263910 --- gcc/ChangeLog | 8 ++++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr87117-2.c | 15 +++++++++++++++ gcc/tree-ssa-pre.c | 3 ++- 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/pr87117-2.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b8c25ba6ea7..dd3ca99c80e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2018-08-28 Richard Biener + + PR tree-optimization/87117 + * tree-ssa-pre.c (compute_avail): Do not make expressions + with predicated values available. + (get_expr_value_id): Assert we do not run into predicated value + expressions. + 2018-08-28 Richard Biener PR tree-optimization/87117 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ddd365ecade..aa6f7707333 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-08-28 Richard Biener + + PR tree-optimization/87117 + * gcc.dg/pr87117-2.c: New testcase. + 2018-08-28 Richard Biener PR tree-optimization/87117 diff --git a/gcc/testsuite/gcc.dg/pr87117-2.c b/gcc/testsuite/gcc.dg/pr87117-2.c new file mode 100644 index 00000000000..aefa813918b --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr87117-2.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fcode-hoisting" } */ + +void e(); + +void a(int c, char **d) +{ + char b; + if (1 < c) + b = (char)(__INTPTR_TYPE__)d[0]; + if (1 < c && b) + e(); + while (1 < c) + ; +} diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 2dce88bd85e..267086cdf48 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -663,6 +663,7 @@ get_expr_value_id (pre_expr expr) id = VN_INFO (PRE_EXPR_NAME (expr))->value_id; break; case NARY: + gcc_assert (!PRE_EXPR_NARY (expr)->predicated_values); id = PRE_EXPR_NARY (expr)->value_id; break; case REFERENCE: @@ -3902,7 +3903,7 @@ compute_avail (void) continue; vn_nary_op_lookup_stmt (stmt, &nary); - if (!nary) + if (!nary || nary->predicated_values) continue; /* If the NARY traps and there was a preceding -- 2.30.2