From: Richard Biener Date: Tue, 28 Aug 2018 10:14:45 +0000 (+0000) Subject: re PR tree-optimization/87117 (ICE in eliminate_dom_walker::eliminate_cleanup(bool... X-Git-Tag: upstream/12.2.0~29534 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f2b0062c10f85110e52ad7daa8bc268cdc262b86;p=platform%2Fupstream%2Fgcc.git 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-sccvn.c (fully_constant_vn_reference_p): Exclude void which is is_gimple_reg_type by checking for COMPLETE_TYPE_P. * gcc.dg/pr87117-1.c: New testcase. From-SVN: r263911 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dd3ca99..694fdf2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,12 @@ 2018-08-28 Richard Biener PR tree-optimization/87117 + * tree-ssa-sccvn.c (fully_constant_vn_reference_p): Exclude + void which is is_gimple_reg_type by checking for COMPLETE_TYPE_P. + +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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index aa6f770..bf4f5f7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,11 @@ 2018-08-28 Richard Biener PR tree-optimization/87117 + * gcc.dg/pr87117-1.c: New testcase. + +2018-08-28 Richard Biener + + PR tree-optimization/87117 * gcc.dg/pr87117-2.c: New testcase. 2018-08-28 Richard Biener diff --git a/gcc/testsuite/gcc.dg/pr87117-1.c b/gcc/testsuite/gcc.dg/pr87117-1.c new file mode 100644 index 0000000..06d7008 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr87117-1.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-inline -fno-tree-dce" } */ + +int a, b, c; +long *d; +void fn1() +{ + for (; 0 < a;) + a++; +} +void fn3() +{ + for (; c; c++) + d[c] = 0; +} +void fn2() +{ + if (b) + fn3(); + fn1(); +} diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index 4267648..381fc8d 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -1408,6 +1408,7 @@ fully_constant_vn_reference_p (vn_reference_t ref) /* Simplify reads from constants or constant initializers. */ else if (BITS_PER_UNIT == 8 + && COMPLETE_TYPE_P (ref->type) && is_gimple_reg_type (ref->type) && (!INTEGRAL_TYPE_P (ref->type) || TYPE_PRECISION (ref->type) % BITS_PER_UNIT == 0))