From: Richard Biener Date: Tue, 28 Aug 2018 13:36:49 +0000 (+0000) Subject: re PR tree-optimization/87124 (ICE have integer_cst in SSA_VAL, at tree-ssa-sccvn... X-Git-Tag: upstream/12.2.0~29528 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49aecbebe25714a59fbd18e4852c411587db1994;p=platform%2Fupstream%2Fgcc.git re PR tree-optimization/87124 (ICE have integer_cst in SSA_VAL, at tree-ssa-sccvn.c:462 while building 541.leela_r from SPEC2017) 2018-08-28 Richard Biener PR tree-optimization/87124 * tree-ssa-sccvn.c (vn_lookup_simplify_result): Guard against constants before looking up avail. * g++.dg/torture/pr87124.C: New testcase. From-SVN: r263918 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 66396a0..20f8d0d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-08-28 Richard Biener + + PR tree-optimization/87124 + * tree-ssa-sccvn.c (vn_lookup_simplify_result): Guard against + constants before looking up avail. + 2018-08-28 Jakub Jelinek PR middle-end/87099 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 64638c5..c007611 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-08-28 Richard Biener + + PR tree-optimization/87124 + * g++.dg/torture/pr87124.C: New testcase. + 2017-08-28 Paul Thomas PR fortran/80477 diff --git a/gcc/testsuite/g++.dg/torture/pr87124.C b/gcc/testsuite/g++.dg/torture/pr87124.C new file mode 100644 index 0000000..3e7d480 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr87124.C @@ -0,0 +1,12 @@ +// { dg-do compile } + +class A { + void m_fn1(); +}; + +void A::m_fn1() +{ + A *a = this; + for (int i; i && a;) + a = 0; +} diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index 39ad0c5..2556b0c 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -5667,7 +5667,7 @@ vn_lookup_simplify_result (gimple_match_op *res_op) res_op->type, ops, &vnresult); /* If this is used from expression simplification make sure to return an available expression. */ - if (res && mprts_hook && rpo_avail) + if (res && TREE_CODE (res) == SSA_NAME && mprts_hook && rpo_avail) res = rpo_avail->eliminate_avail (vn_context_bb, res); return res; }