From patchwork Fri Nov 19 18:56:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: : Use FOR_BB_INSNS in a couple of places Date: Fri, 19 Nov 2010 08:56:17 -0000 From: Uros Bizjak X-Patchwork-Id: 72293 Message-Id: To: gcc-patches@gcc.gnu.org Hello! 2010-11-19 Uros Bizjak * 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. 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;