Skip to content

[ThinLTO] asserts !(Pair.first != Ty && Pair.second == Ty) && "mapping to a source type" failed #35437

@rgal

Description

@rgal
Bugzilla Link 36089
Resolution FIXED
Resolved on Jan 31, 2018 01:03
Version 6.0
OS Linux
Blocks #35152
CC @zmodem,@pogo59,@pcc,@wjristow

Extended Description

This seems related to llvm/llvm-bugzilla-archive#37522 but wasn't fixed by r322103.

At r323433:
$ clang --version
clang version 7.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
...

$ cat a.cpp
void foo() {}
$ cat b.cpp
struct B;
struct C {
C(B &);
};
struct A &fn1() {}
C::C(B &) {}
$ cat c.cpp
struct A &foo();
template <A &() = foo> struct D {};
struct B {
B(A &);
D<> m_list;
};
struct C {
C(B &);
};
void bar() {
B b(foo());
C c(b);
}
$ clang -c -O1 -g -flto=thin a.cpp
$ clang -c -O1 -g -flto=thin b.cpp
b.cpp:5:18: warning: control reaches end of non-void function [-Wreturn-type]
struct A &fn1() {}
^
1 warning generated.
$ clang -c -O1 -g -flto=thin c.cpp
$ llvm-lto -thinlto-action=run a.o b.o c.o
llvm-lto: /home/user/git/llvm/lib/Linker/IRMover.cpp:248: llvm::Type*
{anonymous}::TypeMapTy::get(llvm::Type*, llvm::SmallPtrSet<llvm::StructType*, 8u>&): Assertion
`!(Pair.first != Ty && Pair.second == Ty) && "mapping to a source type"' failed.
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilla

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions