[PATCH] D39950: [DebugInfo] Stable sort symbols to remove non-deterministic ordering

Mandeep Singh Grang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 19:16:13 PST 2017


mgrang added a comment.

In https://reviews.llvm.org/D39950#924114, @probinson wrote:

> The results suggest a different problem.  Emitting the aranges section should happen after the "kittens" and "rainbows" symbols are emitted.  If the symbols were emitted, they should have nonzero and unique order.  I don't see how shuffling the list can result in a different result for the aranges section.
>  Although MCStreamer::AssignFragment looks like it might be a victim of unspecified order-of-evaluation, still I would think the assigned orders remain nonzero and unique per symbol, and that's all that matters here.


The test seems to be failing again and this is what I see on printing the symbols (A.Sym, B.Sym) and their offsets (IA, IB) from inside the sorting function:

RUN 1:
rainbows : 0
kittens : 0

RUN 2:
kittens : 0
rainbows : 0

I don't see AssignFragment being called for these symbols which means GetSymbolOrder would return 0. But these symbols are being emitted so they should have a non-zero offset.
I would need to debug further. I am not really familiar with this code so any pointers would be greatly appreciated :)


Repository:
  rL LLVM

https://reviews.llvm.org/D39950





More information about the llvm-commits mailing list