diff mbox

Fix PR63422 to handle profile insanities

Message ID CAAe5K+U1P8kS5=0Bmb3Zgy1JeqDw-ZCoeQvCa_6dtG3h+7i59w@mail.gmail.com
State New
Headers show

Commit Message

Teresa Johnson Oct. 1, 2014, 4:59 p.m. UTC
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.

Comments

Xinliang David Li Oct. 1, 2014, 5:03 p.m. UTC | #1
Probably need to file a bug to track the copyrename2 problem.

David

On Wed, Oct 1, 2014 at 9:59 AM, Teresa Johnson <tejohnson@google.com> wrote:
> 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
Teresa Johnson Oct. 2, 2014, 4:11 p.m. UTC | #2
On Wed, Oct 1, 2014 at 10:03 AM, Xinliang David Li <davidxl@google.com> wrote:
> Probably need to file a bug to track the copyrename2 problem.

I have filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63443 to track this.

>
> David
>
> On Wed, Oct 1, 2014 at 9:59 AM, Teresa Johnson <tejohnson@google.com> wrote:
>> 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?

Regression tests pass, ok for trunk?

Thanks,
Teresa

---
Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413
Jeff Law Oct. 2, 2014, 6:35 p.m. UTC | #3
On 10/01/14 10:59, Teresa Johnson wrote:
> 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.
OK.
Jeff
Jeff Law Oct. 2, 2014, 6:35 p.m. UTC | #4
On 10/01/14 11:03, Xinliang David Li wrote:
> Probably need to file a bug to track the copyrename2 problem.
Yea, that would definitely be appreciated.

Jeff
diff mbox

Patch

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;
     }
 }