From 4f62605b84a6f6be88c854271a718cd721377c2b Mon Sep 17 00:00:00 2001 From: rakdver Date: Tue, 13 Sep 2005 07:33:49 +0000 Subject: [PATCH] PR tree-optimize/23817 * tree-cfg.c (tree_merge_blocks): Preserve loop closed ssa. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104218 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/tree-cfg.c | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0b7c8bd..e1900f9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-09-13 Zdenek Dvorak + + PR tree-optimize/23817 + * tree-cfg.c (tree_merge_blocks): Preserve loop closed ssa. + 2005-09-13 Alan Modra PR target/23774 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)); -- 2.7.4