This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] config/bfin/bfin.c (hwloop_optimize): Use return false instead of gcc_assert for checking jump_insn.


For bfin looping optimization, after lsetup optimization, it can have
the correct lsetup related insns which causes gcc_assert for jump_insn.

The related bug is Bug 66620.

2015-06-28  Chen Gang  <gang.chen.5i5j@gmail.com>

	* config/bfin/bfin.c (hwloop_optimize): Use return false instead
	of gcc_assert for checking jump_insn.
---
 gcc/config/bfin/bfin.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index 3b4b54e..91866dd 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -3520,7 +3520,13 @@ hwloop_optimize (hwloop_info loop)
       if (vec_safe_length (loop->incoming) > 1
 	  || !(loop->incoming->last ()->flags & EDGE_FALLTHRU))
 	{
-	  gcc_assert (JUMP_P (insn));
+	  if (!JUMP_P (insn))
+	    {
+	      if (dump_file)
+		fprintf (dump_file, ";; loop %d lsetup may already inserted\n",
+			 loop->loop_no);
+	      return false;
+	    }
 	  insn = PREV_INSN (insn);
 	}
 
-- 
1.9.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]