diff mbox

Update compute_transpout

Message ID 4C226BA3.6060905@codesourcery.com
State New
Headers show

Commit Message

Maxim Kuvyrkov June 23, 2010, 8:16 p.m. UTC
This patches addresses 
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33828#c5 .

The comment is indeed outdated and harmless CALL instructions are being 
unjustly treated.

OK to check in?

Comments

Jeff Law June 23, 2010, 9:29 p.m. UTC | #1
On 06/23/10 14:16, Maxim Kuvyrkov wrote:
> This patches addresses 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33828#c5 .
>
> The comment is indeed outdated and harmless CALL instructions are 
> being unjustly treated.
>
> OK to check in?
>
OK.  Thanks,

Jeff
diff mbox

Patch

diff --git a/gcc/gcse.c b/gcc/gcse.c
index 45eb7bc..09f8ddf 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -4117,12 +4117,18 @@  compute_transpout (void)
 
   FOR_EACH_BB (bb)
     {
-      /* Note that flow inserted a nop at the end of basic blocks that
-	 end in call instructions for reasons other than abnormal
-	 control flow.  */
       if (! CALL_P (BB_END (bb)))
 	continue;
 
+      if (EDGE_COUNT (bb->succs) == 1
+	  && !(EDGE_SUCC (bb, 0)->flags & EDGE_COMPLEX))
+	/* The call insn doesn't involve any special control flow and
+	   just happens to be the last in basic block.  */
+	{
+	  gcc_assert (EDGE_SUCC (bb, 0)->flags & EDGE_FALLTHRU);
+	  continue;
+	}
+
       for (i = 0; i < expr_hash_table.size; i++)
 	for (expr = expr_hash_table.table[i]; expr ; expr = expr->next_same_hash)
 	  if (MEM_P (expr->expr))