<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 - LowerTypeTest BitSetBuilder causes Access Violation"
   href="https://bugs.llvm.org/show_bug.cgi?id=43535">43535</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LowerTypeTest BitSetBuilder causes Access Violation
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>COFF
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>donovan.t.maas@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=22618" name="attach_22618" title="The project file with all of the compilation settings">attachment 22618</a> <a href="attachment.cgi?id=22618&action=edit" title="The project file with all of the compilation settings">[details]</a></span>
The project file with all of the compilation settings

This happens in LLVM 8.0.1 that ships MSVC 2019 16.3.2, the downloadable
binaries for LLVM 9.0.0, and the custom build for the stack trace that was
cloned and built from commit e3887253165cd6c40accf3ce1534ef0d20ec676b. The OS
is Windows 10 Pro 64Bit Version 1903, Build 18362.356, I am running on an AMD
Ryzen 7 3700X with 16GiB of RAM.

Visual Studio reported that the invalid address was 0x0000000000000008.

When compiling in Release mode the linker crashes and performs a stack dump. It
is able to build without error in Debug mode which leads me to believe it is
caused by some optimization setting. I've included the project file which has
all of the build settings. I have spent several hours fiddling with the
settings of this project and its dependencies and I've yet to identify what is
causing this issue. The differences between Debug and Release are:

UseDebugLibraries: Yes -> No
WholeProgramOptimization: No -> Yes
Optimization: /Od (Disabled) -> /O2 (Maximum Speed)
InlineFunctionExpansion: Default -> /Ob2 (Any Suitable)
FavorSizeOrSpeed: Neither -> /Ot (Favor Fast Code)
OmitFramePointers: No -> Yes
RuntimeLibrary: /MTd (Multi-Threaded Debug Static) -> /MT (Multi-Threaded
Release Static)

GenerateDebugInfo: /DEBUG:FASTLINK -> /DEBUG:FULL

Stack Trace:
lld-link.exe!llvm::lowertypetests::BitSetBuilder::build(void)
lld-link.exe!llvm::lowertypetests::isJumpTableCanonical(class llvm::Function *)
lld-link.exe!llvm::LowerTypeTestsPass::run(class llvm::Module &,class
llvm::AnalysisManager<class llvm::Module> &)
lld-link.exe!llvm::FPPassManager::runOnModule(class llvm::Module &)
lld-link.exe!llvm::legacy::PassManager::run(class llvm::Module &)
lld-link.exe!llvm::detail::PassModel<class llvm::Module,class
llvm::VerifierPass,class llvm::PreservedAnalyses,class
llvm::AnalysisManager<class llvm::Module> >::run(class llvm::Module &,class
llvm::AnalysisManager<class llvm::Module> &)
lld-link.exe!llvm::detail::PassModel<class llvm::Module,class
llvm::VerifierPass,class llvm::PreservedAnalyses,class
llvm::AnalysisManager<class llvm::Module> >::name(void)
lld-link.exe!llvm::lto::backend(struct llvm::lto::Config &,class
std::function<class std::unique_ptr<class llvm::lto::NativeObjectStream,struct
std::default_delete<class llvm::lto::NativeObjectStream> > >,unsigned int,class
std::unique_ptr<class llvm::Module,struct std::default_delete<class
llvm::Module> >,class llvm::ModuleSummaryIndex &)
lld-link.exe!llvm::lto::LTO::runRegularLTO(class std::function<class
std::unique_ptr<class llvm::lto::NativeObjectStream,struct
std::default_delete<class llvm::lto::NativeObjectStream> > >)
lld-link.exe!llvm::lto::LTO::run(class std::function<class
std::unique_ptr<class llvm::lto::NativeObjectStream,struct
std::default_delete<class llvm::lto::NativeObjectStream> > >,class
std::function<class std::function<class std::unique_ptr<class
llvm::lto::NativeObjectStream,struct std::default_delete<class
llvm::lto::NativeObjectStream> > > >)
lld-link.exe!lld::coff::BitcodeCompiler::compile(void)
lld-link.exe!lld::coff::SymbolTable::addCombinedLTOObjects(void)
lld-link.exe!lld::coff::LinkerDriver::link(class llvm::ArrayRef<char const *>)
lld-link.exe!lld::coff::link(class llvm::ArrayRef<char const *>,bool,class
llvm::raw_ostream &)
lld-link.exe!main()
[Inline Frame] lld-link.exe!invoke_main() Line 78
    at
d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(78)
lld-link.exe!__scrt_common_main_seh() Line 288
    at
d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(288)
kernel32.dll!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()</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>