> > Hmm. I do wonder whether your earlier patch was more "correct" in the > sense that a tail call does not return to the calling function but its caller. > That means it should not have a fallthru edge, so our representation > with feeding a return value to a function-local return stmt isn't a good one. > > That said, the CFG hook you are patching is supposed to add edges when > a function call can possibly not reach the return stmt and I think that's > the case for tail-calls. So IMO the patch is wrong. Iff instead the > instrumentation confuses later tail-call verification then this > instrumentation > should be either not emitted or handled there.
For the edge profling algorithm to be able to fill in missing counters correctly, every valid execution must correspond to a path from entry block to exit block. So we need an edge here, but we can mark it as non-intrumentable (Which works fine with the version of patch Richi approved). Sorry for late reaction on this. I am trying to catch up with reviews now. Honza