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] Fix PR63422 to handle profile insanities


This patch removes some asserts my jump threading patch r215739 added.
An upstream pass (copyrename2) is introducing some bogus profile
counts, so we can't assert that counts are 0 when there is no profile
data for the function.

Tested on testcase attached to PR63422. Currently running gcc
regression tests for x86_64-unknown-linux-gnu. Ok for trunk if that
passes?

Thanks,
Teresa

2014-10-01  Teresa Johnson  <tejohnson@google.com>

        PR middle-end/63422
        * tree-ssa-threadupdate.c (freqs_to_counts_path): Remove
        asserts to handle incoming insanities.

Index: tree-ssa-threadupdate.c
===================================================================
--- tree-ssa-threadupdate.c     (revision 215739)
+++ tree-ssa-threadupdate.c     (working copy)
@@ -977,20 +977,14 @@ freqs_to_counts_path (struct redirection_data *rd)
   edge ein;
   edge_iterator ei;
   FOR_EACH_EDGE (ein, ei, e->dest->preds)
-    {
-      gcc_assert (!ein->count);
-      ein->count = EDGE_FREQUENCY (ein);
-    }
+    ein->count = EDGE_FREQUENCY (ein);

   for (unsigned int i = 1; i < path->length (); i++)
     {
       edge epath = (*path)[i]->e;
-      gcc_assert (!epath->count);
       edge esucc;
       FOR_EACH_EDGE (esucc, ei, epath->src->succs)
-        {
-          esucc->count = EDGE_FREQUENCY (esucc);
-        }
+        esucc->count = EDGE_FREQUENCY (esucc);
       epath->src->count = epath->src->frequency;
     }
 }


-- 
Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413


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