diff mbox

: Use FOR_BB_INSNS in a couple of places

Message ID AANLkTik3-U5qTn+iFbOMMgeO+g9eHENgnoDY5Prk2XR8@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak Nov. 19, 2010, 6:56 p.m. UTC
Hello!

2010-11-19  Uros Bizjak  <ubizjak@gmail.com>

	* mode-switching.c (optimize_mode_switching): Use
	FOR_BB_INSNS instead of open-coded for loop.
	* cfgrtl.c (redirect_branch_edge): Ditto.

Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline SVN.

Uros.
diff mbox

Patch

Index: mode-switching.c
===================================================================
--- mode-switching.c	(revision 166931)
+++ mode-switching.c	(working copy)
@@ -518,9 +518,7 @@  optimize_mode_switching (void)
 	      }
 	  }
 
-	  for (insn = BB_HEAD (bb);
-	       insn != NULL && insn != NEXT_INSN (BB_END (bb));
-	       insn = NEXT_INSN (insn))
+	  FOR_BB_INSNS (bb, insn)
 	    {
 	      if (INSN_P (insn))
 		{
Index: cfgrtl.c
===================================================================
--- cfgrtl.c	(revision 166931)
+++ cfgrtl.c	(working copy)
@@ -1062,8 +1062,7 @@  redirect_branch_edge (edge e, basic_bloc
     /* When expanding this BB might actually contain multiple
        jumps (i.e. not yet split by find_many_sub_basic_blocks).
        Redirect all of those that match our label.  */
-    for (insn = BB_HEAD (src); insn != NEXT_INSN (BB_END (src));
-	 insn = NEXT_INSN (insn))
+    FOR_BB_INSNS (src, insn)
       if (JUMP_P (insn) && !patch_jump_insn (insn, old_label, target))
 	return NULL;