Message ID | 20101117064421.GA30836@intel.com |
---|---|
State | New |
Headers | show |
On Wed, Nov 17, 2010 at 7:44 AM, H.J. Lu <hongjiu.lu@intel.com> wrote: > insn != BB_END (bb) && NEXT_INSN (insn) == NEXT_INSN (BB_END (bb)) > > We should check NEXT_INSN (insn) != NEXT_INSN (BB_END (bb)) in > move_or_delete_vzeroupper_2. This patch does it. Huh? The loop does simple linear scan of all insns in the bb, so it can't miss BB_END. IIUC, in your case the bb does not have BB_END (bb), but it has NEXT_INSN (BB_END (bb))? Can you please provide a test case that illustrates this? Uros.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index e52f9b2..704a67d 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -108,7 +108,7 @@ check_avx256_stores (rtx dest, const_rtx set, void *data) static void move_or_delete_vzeroupper_2 (basic_block bb, bool upper_128bits_set) { - rtx insn; + rtx insn, last; rtx vzeroupper_insn = NULL_RTX; rtx pat; int avx256; @@ -118,9 +118,12 @@ move_or_delete_vzeroupper_2 (basic_block bb, bool upper_128bits_set) bb->index, upper_128bits_set); insn = BB_HEAD (bb); + last = NEXT_INSN (BB_END (bb)); while (insn != BB_END (bb)) { insn = NEXT_INSN (insn); + if (insn == last) + break; if (!NONDEBUG_INSN_P (insn)) continue;