]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-cfg.c (remove_forwarder_block_with_phi): Look at the first label to see if it...
authorKazu Hirata <kazu@cs.umass.edu>
Sat, 22 Jan 2005 16:13:40 +0000 (16:13 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sat, 22 Jan 2005 16:13:40 +0000 (16:13 +0000)
* tree-cfg.c (remove_forwarder_block_with_phi): Look at the
first label to see if it is a nonlocal label.

From-SVN: r94067

gcc/ChangeLog
gcc/tree-cfg.c

index d74b1f81ab199e09a815ce8301078749f7c82d83..73db887aff196fdc647d3be635274c89ee69068a 100644 (file)
@@ -6,6 +6,9 @@
        config/sparc/freebsd.h, config/sparc/netbsd-elf.h,
        config/sparc/sol2.h: Update copyright.
 
+       * tree-cfg.c (remove_forwarder_block_with_phi): Look at the
+       first label to see if it is a nonlocal label.
+
 2005-01-22  David Edelsohn  <edelsohn@gnu.org>
             Andrew Pinski  <pinskia@physics.uc.edu>
 
index 93dfc343f8289255f3a42a9326e5ef35e22442e8..b69ec0cd2112f29cc3fa8855917cfb5e39ee09b9 100644 (file)
@@ -4130,8 +4130,8 @@ remove_forwarder_block_with_phi (basic_block bb)
 {
   edge succ = EDGE_SUCC (bb, 0);
   basic_block dest = succ->dest;
+  tree label;
   basic_block dombb, domdest, dom;
-  block_stmt_iterator bsi;
 
   /* We check for infinite loops already in tree_forwarder_block_p.
      However it may happen that the infinite loop is created
@@ -4141,16 +4141,11 @@ remove_forwarder_block_with_phi (basic_block bb)
 
   /* If the destination block consists of a nonlocal label, do not
      merge it.  */
-  for (bsi = bsi_start (dest); !bsi_end_p (bsi); bsi_next (&bsi))
-    {
-      tree stmt = bsi_stmt (bsi);
-
-      if (TREE_CODE (stmt) != LABEL_EXPR)
-       break;
-
-      if (DECL_NONLOCAL (LABEL_EXPR_LABEL (stmt)))
-       return;
-    }
+  label = first_stmt (dest);
+  if (label
+      && TREE_CODE (label) == LABEL_EXPR
+      && DECL_NONLOCAL (LABEL_EXPR_LABEL (label)))
+    return;
 
   /* Redirect each incoming edge to BB to DEST.  */
   while (EDGE_COUNT (bb->preds) > 0)