Patchwork : Use FOR_BB_INSNS in a couple of places

login
register
mail settings
Submitter Uros Bizjak
Date Nov. 19, 2010, 6:56 p.m.
Message ID <AANLkTik3-U5qTn+iFbOMMgeO+g9eHENgnoDY5Prk2XR8@mail.gmail.com>
Download mbox | patch
Permalink /patch/72293/
State New
Headers show

Comments

Uros Bizjak - Nov. 19, 2010, 6:56 p.m.
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.

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;