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


> 
> Taking a flying leap here (I'm about to leave for the airport), it may
> be this code:
>    /* It has no immediate dom or only ENTRY_BLOCK or EXIT_BLOCK.
>              If it is a child of ENTRY_BLOCK that's OK, and it's only
>              dominated by itself; if it's _not_ a child of ENTRY_BLOCK, it
>              means, it is unreachable.  That case has been disallowed in the
>              building of the DFS tree, so we are save here.  For the reverse
>              flow graph it means, it has no children, so, to be compatible
>              with the old code, we set the post_dominators to all one.  */
>           if (!di->dom[i])
>             {
>               sbitmap_ones (dominators[bb]);
>             }
:)
I see. De-facto it is correct.  A postdominates B ifif each way from B to exit
contains A.

If B has no succesors, the condition holds.

In case we want to keep it this way, I can fix the branch predictor by doing
the predicting only for first reached basic block with no succesor.

On the other hand, it may make sense to make this value more meaningfull.
I think one can easilly assume that if A postdominates B, A is reachable
from B, so perhaps this should be fixed by linking such basic blocks
to some "swamp" block linked to exit.

Problem is that we need to detect thinks as infinite loops (BTW the postdominators
inside infinite loop - not so incommon case are more than crazy now.)

Honza


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