[llvm-bugs] [Bug 35247] New: [ThinLTO] Assertion `!Ty->isFunctionTy() && PointerType::isValidElementType(Ty) && "invalid type for global variable"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 8 07:44:47 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=35247

            Bug ID: 35247
           Summary: [ThinLTO] Assertion `!Ty->isFunctionTy() &&
                    PointerType::isValidElementType(Ty) && "invalid type
                    for global variable"' failed.
           Product: new-bugs
           Version: 5.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: russell_gallop at sn.scee.net
                CC: llvm-bugs at lists.llvm.org

Tested at r316607 on release_50.

==> a.cpp <==
int* A();

int main() {
  int* s(A());
}

==> b.cpp <==
struct SF {
  SF();
};

SF::SF() {}

SF* A() {
  new SF();
}
$ clang -o a.o -flto=thin -c a.cpp
$ clang -o b.o -flto=thin -c b.cpp
$ llvm-lto a.o b.o --thinlto-action=run
llvm-lto: .../llvm/lib/IR/Globals.cpp:317:
llvm::GlobalVariable::GlobalVariable(llvm::Module&, llvm::Type*, bool,
llvm::GlobalValue::LinkageTypes, llvm::Constant*, const llvm::Twine&,
llvm::GlobalVariable*, llvm::GlobalValue::ThreadLocalMode, unsigned int, bool):
Assertion `!Ty->isFunctionTy() && PointerType::isValidElementType(Ty) &&
"invalid type for global variable"' failed.

Not seen on master (r317500).

Note that there are multiple versions of A() in this example. With this fixed,
there is no assertion failure.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171108/3eb851b7/attachment.html>


More information about the llvm-bugs mailing list