[llvm-dev] lld/lto/win32 crash on DIE code
Evgeny Leviant via llvm-dev
llvm-dev at lists.llvm.org
Wed Mar 21 03:58:05 PDT 2018
Ok, I've done a bit more investigation. I found the module which declares broken DIE
(e54b3dc8c0536e29a65f8548b5ae7958-Global.o) and here is what I found there:
!2 = !DIFile(filename: "island.windows.elements", ...
...
!4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !5, ...
!5 = !DIFile(filename: "island.windows.elements-e54b3dc8c0536e29a65f8548b5ae7958-global", ...
All subsequent DIEs reference file !2, except DICompileUnit (!4) which references file !5. This seems a bit
strange for me. Can't this be a root cause of your problems?
________________________________________
От: Carlo Kok <ck at remobjects.com>
Отправлено: 21 марта 2018 г. 12:31
Кому: Evgeny Leviant; llvm-dev at lists.llvm.org
Тема: Re: [llvm-dev] lld/lto/win32 crash on DIE code
Op 21-3-2018 om 10:28 schreef Evgeny Leviant:
> It looks the problem lies in how your compiler generates debug info. LLVM doesn't
> expect DIDerivedType scope to be an instance of DICompileUnit. Here is a quick fix:
>
> DIE *DwarfUnit::getOrCreateContextDIE(const DIScope *Context) {
> - if (!Context || isa<DIFile>(Context))
> + if (!Context || isa<DIFile>(Context) || isa<DICompileUnit>(Context))
>
> However, I suggest talking to someone with in-depth debug info experience, as the problem
> itself seems to be not related to LTO.
The problem seems to be related to that but it *does* support some
DICompileUnits, just not this particular one, I stepped through this
code and it gets a DICompileUnit often enough. Somehow during
LTO/merging I get a type that has a different DICompileUnit than where
the variable is defined, and it's not liking it.
More information about the llvm-dev
mailing list