[PATCH] D54327: Adding debug info to support Fortran (part 3)

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 3 02:28:43 PDT 2019


probinson added a comment.

Regarding your LTO-like experiments, that result is more or less what I thought would happen.  In a normal compilation, each CU gets its own description of the types, and the fact that they are different in different CUs doesn't matter.  Within each CU's context, the common-block description is complete and will be used correctly by the debugger.
In LTO, however, the IR linker wants to de-duplicate debug information, to avoid multiple copies of the same type in the final object file.  I suspect that de-duplication (which IIRC is founded on the C++ "one definition rule") probably should not apply to Fortran, or at least not to common blocks.
This is not something you need to solve today, but I think after this lands, you should file a bug to the effect that LTO with Fortran can produce incorrect debug information, specifically for common blocks.  That will at least keep track of this factoid somewhere that we can find it again.

So: One test comment, you'll need to file that bug, and I am embarrassed to say I haven't looked at the code part of the patch.  But if @dblaikie or @aprantl are happy that's good enough for me.



================
Comment at: test/DebugInfo/Generic/DICommonBlock.ll:13
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-pc-linux-gnu"
+
----------------
Remove the 'target triple' line so this test will still work on bots that don't build the X86 target.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D54327





More information about the llvm-commits mailing list