This is the mail archive of the gcc@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]

Re: bug in dominance algorithm


> Jan Hubicka <jh@suse.cz> writes:
> 
> > Hi,
> > it looks like there is a bug in our dominance tree computation.
> > In case I have two basic blocks with no successors, they are always
> > postdominating each other, that is IMO false.
> > Can someone more familiar with the algorithm check it?
> 
> I checked it against the implementations in other compilers (Almost
> all use the same algorithm), and it looks just fine.
> I didn't do an exhaustive check, however, and may have missed
> something.
> 
> Can you send me some quick C code to demonstrate the problem?
> I'm having a bit of trouble generating two basic blocks with no
> successors, that it say postdominate each other.
I was reproducing it on something like

#include <stdlib.h>
test(int a, int b)
{
  if (a)
    abort();
  if (b)
    abort();
}

Now my branch predicting algorithm identifies two blocks with no exists
(1 and 3). Then it does for each of them (B) following:

looks and for each basic block (C) that has postdominator B it looks for each
entry edge.  If some of the edge goes from block that has no postdominator B,
it marks the edge as improbable.

Problem is that each edge gets marked as many times as many aborts are in the
function.
I've checked that 1 is set as postdominator of 3 and vice vesa.
Both is wrong IMO

Honza
> 
> --Dan
> > 
> > Honza
> 
> -- 
> "This is my impression of a bowling ball...  (Drags the mike
> along the floor, then lifts it...)  Gutter...
> "-Steven Wright


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