diff options
author | Richard Biener <rguenther@suse.de> | 2018-11-22 14:08:44 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2018-11-22 14:08:44 +0000 |
commit | e5f0e0412b9aa61d960ffbb83327415da226f266 (patch) | |
tree | d266b058a6df69881af86beaa6a61db1bd683569 /gcc/tree-ssa-sccvn.c | |
parent | 9479946c1fc1177c4709115c454b91395092e0db (diff) | |
download | gcc-e5f0e0412b9aa61d960ffbb83327415da226f266.zip gcc-e5f0e0412b9aa61d960ffbb83327415da226f266.tar.gz gcc-e5f0e0412b9aa61d960ffbb83327415da226f266.tar.bz2 |
re PR tree-optimization/88148 (ICE in tree_nop_conversion_p at gcc/tree.c:12550 since r264273)
2018-11-22 Richard Biener <rguenther@suse.de>
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
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r-- | gcc/tree-ssa-sccvn.c | 11 |
1 files changed, 11 insertions, 0 deletions
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)) |