[llvm-bugs] [Bug 51564] New: IRMover warning "Linking two modules of different target triples" crashes clang

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Aug 20 14:28:35 PDT 2021


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

            Bug ID: 51564
           Summary: IRMover warning "Linking two modules of different
                    target triples" crashes clang
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvm at inglorion.net
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

See https://bugs.chromium.org/p/chromium/issues/detail?id=1128437

This is a ThinLTO build, where clang is invoked with -fthinlto-index to
generate machine code.

IRMover.cpp contains code to check that when linking two IR modules together,
their target triples are compatible. In this case they are not, so a warning
diagnostic is generated.

The diagnostic is handled by BackendConsumer::DiagnosticHandlerImpl in
clang/lib/CodeGen/CodeGenAction.cpp. This contains an assert that CurLinkModule
is set. When LLVM is built with asserts enabled, this assert will crash the
compiler, even if the diagnostic never results in a message to the user.
Immediately after that assert, the diagnostic is in fact ignored, so we're
crashing the compiler for a diagnostic that we never surface.

-- 
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/20210820/03557f2b/attachment.html>


More information about the llvm-bugs mailing list