From d7f0e25cd0e994e9f95e7709e0d6c6df587463a6 Mon Sep 17 00:00:00 2001 From: Zdenek Dvorak Date: Tue, 13 Sep 2005 09:33:49 +0200 Subject: re PR tree-optimization/23817 (ICE in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:398) PR tree-optimize/23817 * tree-cfg.c (tree_merge_blocks): Preserve loop closed ssa. From-SVN: r104218 --- gcc/tree-cfg.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'gcc/tree-cfg.c') diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 75c14f4..d5d466e 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -1314,8 +1314,17 @@ tree_merge_blocks (basic_block a, basic_block b) { tree def = PHI_RESULT (phi), use = PHI_ARG_DEF (phi, 0); tree copy; - - if (!may_propagate_copy (def, use)) + bool may_replace_uses = may_propagate_copy (def, use); + + /* In case we have loops to care about, do not propagate arguments of + loop closed ssa phi nodes. */ + if (current_loops + && is_gimple_reg (def) + && TREE_CODE (use) == SSA_NAME + && a->loop_father != b->loop_father) + may_replace_uses = false; + + if (!may_replace_uses) { gcc_assert (is_gimple_reg (def)); -- cgit v1.1