<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - wasm comdat triggers exception"
   href="https://bugs.llvm.org/show_bug.cgi?id=42507">42507</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>wasm comdat triggers exception
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: WebAssembly
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ck@remobjects.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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):
```
<span class="quote">>        llc.exe!HandleAbort(int Sig) Line 408   C++</span >
        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</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>