[PATCH] D29310: Fix DwarfDebug assertions with LTO mixing -g and -gmlt

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 15:05:55 PST 2017


probinson added inline comments.


================
Comment at: test/DebugInfo/X86/dbg-abstract-vars-g-gmlt.ll:1
+; RUN: llc < %s -filetype=obj | llvm-dwarfdump - -debug-dump=info | FileCheck %s
+;
----------------
dblaikie wrote:
> Here's the simplest example I have for this (also doesn't require optimizations either at compile time or after the link step (though they can be used to tidy up the IR a little):
> 
>   // first file
>   void f1();
>   inline __attribute__((always_inline)) void f2(int) {
>     f1();
>   }
>   void f3() {
>     f2();
>   }
> 
>   // second file
>   void f() {
>   }
>     
I have not been able to get your example to crash on an unmodified compiler, can you provide more details?


================
Comment at: test/DebugInfo/X86/dbg-value-g-gmlt.ll:1
+; RUN: llc -filetype=obj < %s | llvm-dwarfdump - -debug-dump=info | FileCheck %s
+;
----------------
dblaikie wrote:
> Interestingly, this still seems to trigger the assert:
> 
>   void f()
>   void foo(int param) {
>     if (param)
>       f();
>   }
> 
>   void foo(int);
>   void bar() {
>     foo(0);
>   }
> 
> Which is vaguely worrying - since in this case the call to foo is not/cannot be optimized away, so I'm not sure what the assertion is telling us here. There should be instructions for the function & so we shouldn't be in that codepath.
Why can't it be inlined away?  bar() calls foo(), foo() gets inlined into bar(), the constant 0 parameter is propagated to the 'if', the condition is guaranteed false therefore the 'if/then' goes away, poof all gone.  Except for the dbg.value describing the inlined copy of 'param'.


https://reviews.llvm.org/D29310





More information about the llvm-commits mailing list