[PATCH] D93441: [DebugInfo] Fix crash with -fdebug-info-for-profiling and split dwarf

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 17 16:24:22 PST 2020


rupprecht marked 3 inline comments as done.
rupprecht added inline comments.


================
Comment at: llvm/test/DebugInfo/X86/debug-info-for-profiling-crash.ll:4-8
+; struct b {
+;   template <typename c>
+;   void d(c e) { d(e); }
+; };
+; void f() { b a; a.d(0); }
----------------
dblaikie wrote:
> rupprecht wrote:
> > dblaikie wrote:
> > > A slightly simpler/more canonical test that seems to reproduce the crash would be:
> > > ```
> > > void f1();
> > > __attribute__((always_inline)) inline void f2() { f1(); }
> > > void f3() { f2(); }
> > > ```
> > > This is the smallest/simplest example of inlining, reproduces without extra instructions at -O0, etc.
> > Looks like that runs into the second crash I'm looking at, but isn't dwarf-5 specific, so I'll take a look at that :)
> ah, fair enough - maybe there's a common fix, especially if we move in the direction of debug-info-for-profiling not applying to split-dwarf-inlining info.
Managed to fix that crash too, but it looks like the original repro (with dwarf 5) still has a crash, so I replaced the IR with that example.


================
Comment at: llvm/test/DebugInfo/X86/debug-info-for-profiling-crash.ll:26-40
+;; Note: .debug_info.dwo has the same basic structure as .debug_info
+
+; CHECK: .debug_info.dwo contents:
+; CHECK:    DW_TAG_compile_unit
+; CHECK:      DW_TAG_structure_type
+; CHECK:        DW_TAG_subprogram
+; CHECK:          DW_AT_linkage_name  ("_ZN1b1dIiEEvT_")
----------------
dblaikie wrote:
> I'd probably skip this bit - if anything, maybe a comparison with -gmlt -fdebug-info-for-profiling would be a more Apples to Apples take (the split-dwarf-inlining is meant to, roughly, give the same experience as -gmlt in the object file).
Removed.

I do still need the `; CHECK: .debug_info.dwo contents:`line, because otherwise the section above may match the .debug_info.dwo section. (Hmm, I guess dwarfdump can probably filter on just a single section instead...)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93441



More information about the llvm-commits mailing list