[llvm-bugs] [Bug 42507] New: wasm comdat triggers exception

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 4 01:53:38 PDT 2019


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

            Bug ID: 42507
           Summary: wasm comdat triggers exception
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: WebAssembly
          Assignee: unassignedbugs at nondot.org
          Reporter: ck at remobjects.com
                CC: llvm-bugs at lists.llvm.org

Given this wasm:

```
target triple = "wasm32"

@__start_ELRTMLRR = external global i32
@__stop_ELRTMLRR = external global i32
@"ms_t7__1sTypee_GetMethodStart$MD" = local_unnamed_addr constant { [16 x i8],
i32* ()* } { [16 x i8] c"\CA\F0\D0\A07\CEi\B1\0F\BEkAqI\ED\BA", i32* ()*
@ms_t7__1sTypee_GetMethodStart }, section "ELRTMLRR",
comdat($ms_t7__1sTypee_GetMethodStart), align 1
@"ms_t7__1sTyped_GetMethodsEnd$MD" = local_unnamed_addr constant { [16 x i8],
i32* ()* } { [16 x i8] c"\0E\BFR\1EJ+G\D7\F8B\96\9B3\E1\8D%", i32* ()*
@ms_t7__1sTyped_GetMethodsEnd }, section "ELRTMLRR",
comdat($ms_t7__1sTyped_GetMethodsEnd), align 1

$ms_t7__1sTypee_GetMethodStart = comdat any
$ms_t7__1sTyped_GetMethodsEnd = comdat any


define nonnull i32* @ms_t7__1sTypee_GetMethodStart() comdat{
BasicBlock229:
  ret i32* @__start_ELRTMLRR
}

define nonnull i32* @ms_t7__1sTyped_GetMethodsEnd()  comdat{
BasicBlock232:
  ret i32* @__stop_ELRTMLRR
}

```

llc -filetype obj file.ll 
triggers an assertion (in debug profile):
```
>	llc.exe!HandleAbort(int Sig) Line 408	C++
        ucrtbased.dll!00007fff0c8ebba1()        Unknown
        ucrtbased.dll!00007fff0c8ed7f9()        Unknown
        ucrtbased.dll!00007fff0c8f3425()        Unknown
        ucrtbased.dll!00007fff0c8f2f97()        Unknown
        ucrtbased.dll!00007fff0c8f1001()        Unknown
        ucrtbased.dll!00007fff0c8f398f()        Unknown
        llc.exe!llvm::MCContext::createSymbol(llvm::StringRef Name, bool
AlwaysAddSuffix, bool CanBeUnnamed) Line 201   C++
        llc.exe!llvm::MCContext::getWasmSection(const llvm::Twine & Section,
llvm::SectionKind Kind, const llvm::MCSymbolWasm * GroupSym, unsigned int
UniqueID, const char * BeginSymName) Line 514    C++
        llc.exe!llvm::MCContext::getWasmSection(const llvm::Twine & Section,
llvm::SectionKind K, const llvm::Twine & Group, unsigned int UniqueID, const
char * BeginSymName) Line 496 C++
        llc.exe!llvm::MCContext::getWasmSection(const llvm::Twine & Section,
llvm::SectionKind K, const llvm::Twine & Group, unsigned int UniqueID) Line 463
   C++
       
llc.exe!llvm::TargetLoweringObjectFileWasm::getExplicitSectionGlobal(const
llvm::GlobalObject * GO, llvm::SectionKind Kind, const llvm::TargetMachine &
TM) Line 1710   C++
        llc.exe!llvm::TargetLoweringObjectFile::SectionForGlobal(const
llvm::GlobalObject * GO, llvm::SectionKind Kind, const llvm::TargetMachine &
TM) Line 249        C++
        llc.exe!llvm::AsmPrinter::EmitGlobalVariable(const llvm::GlobalVariable
* GV) Line 525  C++
        llc.exe!llvm::AsmPrinter::doFinalization(llvm::Module & M) Line 1421   
C++
        llc.exe!llvm::FPPassManager::doFinalization(llvm::Module & M) Line 1703
C++
        llc.exe!`anonymous namespace'::MPPassManager::runOnModule(llvm::Module
& M) Line 1781   C++
        llc.exe!llvm::legacy::PassManagerImpl::run(llvm::Module & M) Line 1865 
C++
        llc.exe!llvm::legacy::PassManager::run(llvm::Module & M) Line 1897     
C++
        llc.exe!compileModule(char * * argv, llvm::LLVMContext & Context) Line
604      C++
        llc.exe!main(int argc, char * * argv) Line 355  C++
        llc.exe!invoke_main() Line 79   C++
        llc.exe!__scrt_common_main_seh() Line 288       C++
        llc.exe!__scrt_common_main() Line 331   C++
        llc.exe!mainCRTStartup() Line 17        C++

```

                AlwaysAddSuffix false   bool
                CanBeUnnamed    false   bool
+               Name    "ELRTMLRR"      llvm::StringRef

-- 
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/20190704/d39b98c4/attachment-0001.html>


More information about the llvm-bugs mailing list