This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Properly check the end of basic block
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Uros Bizjak <ubizjak at gmail dot com>
- Date: Tue, 16 Nov 2010 22:44:21 -0800
- Subject: PATCH: Properly check the end of basic block
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
We may have
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.
OK for trunk?
Thanks.
H.J.
----
2010-11-16 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c (move_or_delete_vzeroupper_2): Properly
check the end of basic block.
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;