Patchwork Update compute_transpout

login
register
mail settings
Submitter Maxim Kuvyrkov
Date June 23, 2010, 8:16 p.m.
Message ID <4C226BA3.6060905@codesourcery.com>
Download mbox | patch
Permalink /patch/56710/
State New
Headers show

Comments

Maxim Kuvyrkov - June 23, 2010, 8:16 p.m.
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?
Jeff Law - June 23, 2010, 9:29 p.m.
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

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))