From e5f0e0412b9aa61d960ffbb83327415da226f266 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 22 Nov 2018 14:08:44 +0000 Subject: re PR tree-optimization/88148 (ICE in tree_nop_conversion_p at gcc/tree.c:12550 since r264273) 2018-11-22 Richard Biener PR tree-optimization/88148 * tree-ssa-loop-niter.c (simplify_replace_tree): Get optional valueization callback parameter and handle it. * tree-ssa-loop-niter.h (simplify_replace_tree): Export. * tree-ssa-sccvn.c (process_bb): Eliminate in loop niter trees. * gfortran.dg/pr88148.f90: New testcase. From-SVN: r266378 --- gcc/tree-ssa-sccvn.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gcc/tree-ssa-sccvn.c') diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index 17d9f5e..e0ff405 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -68,6 +68,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-cfgcleanup.h" #include "tree-ssa-loop.h" #include "tree-scalar-evolution.h" +#include "tree-ssa-loop-niter.h" #include "tree-ssa-sccvn.h" /* This algorithm is based on the SCC algorithm presented by Keith @@ -5904,6 +5905,16 @@ process_bb (rpo_elim &avail, basic_block bb, break; } + /* When we visit a loop header substitute into loop info. */ + if (!iterate && eliminate && bb->loop_father->header == bb) + { + /* Keep fields in sync with substitute_in_loop_info. */ + if (bb->loop_father->nb_iterations) + bb->loop_father->nb_iterations + = simplify_replace_tree (bb->loop_father->nb_iterations, + NULL_TREE, NULL_TREE, vn_valueize); + } + /* Value-number all defs in the basic-block. */ for (gphi_iterator gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi)) -- cgit v1.1