So, I'm wondering if anyone can help with where the ultimate problem may
lie here. I've seen some cases where gcc generates branches with the
static branch hints bit set. It is happening because the branch
probability gets set to "always". This happens in
tree-ssa-threadupdate.c:

static void
recompute_probabilities (basic_block bb)
{
  edge esucc;
  edge_iterator ei;
  FOR_EACH_EDGE (esucc, ei, bb->succs)
    {
      if (!bb->count)
        continue;

      /* Prevent overflow computation due to insane profiles.  */
      if (esucc->count < bb->count)
        esucc->probability = GCOV_COMPUTE_SCALE (esucc->count,
                                                 bb->count);
      else {
        /* Can happen with missing/guessed probabilities, since we
           may determine that more is flowing along duplicated
           path than joiner succ probabilities allowed.
           Counts and freqs will be insane after jump threading,
           at least make sure probability is sane or we will
           get a flow verification error.
           Not much we can do to make counts/freqs sane without
           redoing the profile estimation.  */
        esucc->probability = REG_BR_PROB_BASE;
      }
    }
}

It would appear that the guessed counts are getting changed
inconsistently before this during the tree-ssa-dom pass.

Any trail of breadcrumbs to follow through the forest would be helpful
here ...

Thanks!

   Aaron

-- 
Aaron Sawdey, Ph.D.  acsaw...@linux.vnet.ibm.com
050-2/C113  (507) 253-7520 home: 507/263-0782
IBM Linux Technology Center - PPC Toolchain

Reply via email to