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, PR 57782] Wasted work in remove_path()


Hi,

The problem appears in revision 200945 in version 4.9.  I attached
a one-line patch that fixes it.  I also reported this problem at
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57782

In method "remove_path()" in cfgloopmanip.c, the loop on line 343
should break immediately after "irred_invalidated" is set to "true".


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

        * cfgloopmanip.c (remove_path): Exit loop after
        setting irred_invalidated.


Index: gcc/cfgloopmanip.c
===================================================================
--- gcc/cfgloopmanip.c	(revision 201034)
+++ gcc/cfgloopmanip.c	(working copy)
@@ -343,7 +343,11 @@
     FOR_EACH_EDGE (ae, ei, e->src->succs)
       if (ae != e && ae->dest != EXIT_BLOCK_PTR && !bitmap_bit_p (seen,  ae->dest->index)
 	  && ae->flags & EDGE_IRREDUCIBLE_LOOP)
-	irred_invalidated = true;
+	{
+	  irred_invalidated = true;
+	  break;
+	}
+
   for (i = 0; i < nrem; i++)
     {
       bb = rem_bbs[i];


-Chang

Attachment: pr57782_patch.diff
Description: Text document


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