[PR,57787] Wasted work in ix86_pad_returns()
diff mbox

Message ID fef2e86d4047eb516ed58d6be2e300cf.squirrel@webmail.cs.wisc.edu
State New
Headers show

Commit Message

pchang9@cs.wisc.edu July 22, 2013, 6:01 p.m. UTC
Hi,

The problem appears in revision 201034 in version 4.9. I also reported
this problem at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57787.

Bootstrap and regression-tested on x86_64-linux.

In method "ix86_pad_returns()" in i386.c, the loop on line 35723 should
break immediately after "replace" is set to "true".


2013-07-22  Chang  <pchang9@cs.wisc.edu>

        * i386.c (ix86_pad_returns): Exit loop after setting replace.




-Chang

Comments

Jeff Law July 23, 2013, 3:58 p.m. UTC | #1
On 07/22/2013 12:01 PM, pchang9@cs.wisc.edu wrote:
> Hi,
>
> The problem appears in revision 201034 in version 4.9. I also reported
> this problem at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57787.
>
> Bootstrap and regression-tested on x86_64-linux.
>
> In method "ix86_pad_returns()" in i386.c, the loop on line 35723 should
> break immediately after "replace" is set to "true".
>
>
> 2013-07-22  Chang  <pchang9@cs.wisc.edu>
>
>          * i386.c (ix86_pad_returns): Exit loop after setting replace.
Thanks.  Installed.
jeff

Patch
diff mbox

Index: gcc/config/i386/i386.c
===================================================================
--- gcc/config/i386/i386.c	(revision 201034)
+++ gcc/config/i386/i386.c	(working copy)
@@ -35723,7 +35723,10 @@ 
 	  FOR_EACH_EDGE (e, ei, bb->preds)
 	    if (EDGE_FREQUENCY (e) && e->src->index >= 0
 		&& !(e->flags & EDGE_FALLTHRU))
-	      replace = true;
+	      {
+		replace = true;
+		break;
+	      }
 	}
       if (!replace)
 	{