[PATCH] D108261: [DebugInfo] Fix end_sequence of debug_line in LTO Object

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 19 12:31:15 PDT 2021


dblaikie added inline comments.


================
Comment at: llvm/lib/MC/MCObjectStreamer.cpp:517-518
+    auto &Writer = Assembler.getWriter();
+    if (Writer.isSymbolRefDifferenceFullyResolvedImpl(Assembler, *LastLabel,
+                                                      *EndLabel, false))
+      EndSequence = EndLabel;
----------------
kyulee wrote:
> dblaikie wrote:
> > dblaikie wrote:
> > > When is this condition false? (is it tested?)
> > Still curious about this question ^
> I've attempted to delete this symbol diff check in https://reviews.llvm.org/D108261?id=367123 but
> https://buildkite.com/llvm-project/premerge-checks/builds/53063#d29a2537-c103-4035-86a0-4e01e0188dd4 showed many builds failed like
> ```
> Assertion failed: Abs && "We created a line delta with an invalid expression" 
> ```
> So, I restored this logic back.
> 
> 
> As for `InSet = false`, I think it confirms the absolute symbol difference, or this check can be true optimistically by https://github.com/llvm/llvm-project/blob/d480f968ad8b56d3ee4a6b6df5532d485b0ad01e/llvm/lib/MC/MachObjectWriter.cpp#L680-L681.
> I tested the following test could fail if I set `InSet = true`.
> ```
> DebugInfo/X86/gmlt.test
> ```
> 
This seems suspicious to me - "isSymbolRefDifferenceFullyResolvedImpl" (also a bit suspicious that this is calling an "Impl" function - usually those are only used as implementation details for some non-impl function, where the latter is intended as the general entry point) should only return false if the two symbols aren't in the same section. I wouldn't've thought that should happen - when/where/how/why does that happen?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108261/new/

https://reviews.llvm.org/D108261



More information about the llvm-commits mailing list