tree-ssa-threadupdate.c (def_split_header_continue_p): Do not escape the loop.
authorJan Hubicka <jh@suse.cz>
Fri, 12 Oct 2012 20:38:19 +0000 (22:38 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 12 Oct 2012 20:38:19 +0000 (20:38 +0000)
* tree-ssa-threadupdate.c (def_split_header_continue_p): Do not
escape the loop.

From-SVN: r192414

gcc/ChangeLog
gcc/tree-ssa-threadupdate.c

index f628e709a85eeb248317b82f50d3a8b58ad4f9e2..8ece083d1cd112eb0fc074089f674c08e9a11a2b 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-12  Jan Hubicka <jh@suse.cz>
+
+       * tree-ssa-threadupdate.c (def_split_header_continue_p): Do not
+       escape the loop.
+
 2012-10-12  Jan Hubicka <jh@suse.cz>
 
        * web.c (web_main): Do not set DF_RD_PRUNE_DEAD_DEFS flag.
index 2eee50ee1d6c69d425552014d9ea36f780bb9bdc..ad64876c3391b49c01414c467f72b95aafad9f7a 100644 (file)
@@ -846,9 +846,15 @@ static bool
 def_split_header_continue_p (const_basic_block bb, const void *data)
 {
   const_basic_block new_header = (const_basic_block) data;
-  return (bb != new_header
-         && (loop_depth (bb->loop_father)
-             >= loop_depth (new_header->loop_father)));
+  const struct loop *l;
+
+  if (bb == new_header
+      || loop_depth (bb->loop_father) < loop_depth (new_header->loop_father))
+    return false;
+  for (l = bb->loop_father; l; l = loop_outer (l))
+    if (l == new_header->loop_father)
+      return true;
+  return false;
 }
 
 /* Thread jumps through the header of LOOP.  Returns true if cfg changes.