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]

Re: [patch] Add discriminators to DWARF line table


> Why is this only necessary when the edge source and destination are
> part of the same line? ?Imagine a conditional branch on line 5:
>
> line 5 -> line 6 first half -> line 7
> line 5 -> line 6 second half -> line 7
>
> If we don't discriminate between the two 'line 6' blocks, then
> profiling won't tell us which edge was taken out of line 5. ?I
> don't have a straightforward C example, but I'm sure one could be
> constructed given optimization. ?Perhaps:
>
> ?x = (y > 0);
> ?j = x ? foo () : bar ();
> ?done ();
>
> Anyway, you get the picture.

Good example -- I'll have to look at it more carefully, but I think
that at the point I'm assigning discriminators, the edges will still
appear to be from line 6 to line 6, and we'll get unique
discriminators assigned for each block. Any subsequent optimizations
will preserve those discriminators as long as the blocks themselves
don't get removed at some point (a problem I acknowledged that I may
need to fix later).

-cary


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