Regression

LLVM.Transforms/DeadStoreElimination/MSSA.crash.ll (from LLVM)

Failing for the past 1 build (Since Failed#6936 )
Took 23 sec.

Stacktrace

Script:
--
: 'RUN: at line 1';   /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/opt < /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm-project/llvm/test/Transforms/DeadStoreElimination/MSSA/crash.ll -basicaa -dse -enable-dse-memoryssa -S
--
Exit Code: 134

Command Output (stderr):
--
=================================================================
==44493==ERROR: AddressSanitizer: heap-use-after-free on address 0x60d0000048d0 at pc 0x000112506774 bp 0x7ffee210f650 sp 0x7ffee210f648
READ of size 1 at 0x60d0000048d0 thread T0
    #0 0x112506773 in (anonymous namespace)::eliminateDeadStoresMemorySSA(llvm::Function&, llvm::AAResults&, llvm::MemorySSA&, llvm::DominatorTree&, llvm::PostDominatorTree&, llvm::TargetLibraryInfo const&) Value.h:485
    #1 0x11187ab64 in llvm::FPPassManager::runOnFunction(llvm::Function&) LegacyPassManager.cpp:1482
    #2 0x11187b6cb in llvm::FPPassManager::runOnModule(llvm::Module&) LegacyPassManager.cpp:1518
    #3 0x11187c49f in llvm::legacy::PassManagerImpl::run(llvm::Module&) LegacyPassManager.cpp:1583
    #4 0x10db42829 in main opt.cpp:940
    #5 0x7fff7dcae084 in start+0x0 (libdyld.dylib:x86_64+0x17084)

0x60d0000048d0 is located 64 bytes inside of 144-byte region [0x60d000004890,0x60d000004920)
freed by thread T0 here:
    #0 0x11efaf64d in wrap__ZdlPv+0x7d (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x5264d)
    #1 0x11077b231 in llvm::iplist_impl<llvm::simple_ilist<llvm::MemoryAccess, llvm::ilist_tag<llvm::MSSAHelpers::AllAccessTag> >, llvm::ilist_traits<llvm::MemoryAccess> >::erase(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MemoryAccess, false, false, llvm::MSSAHelpers::AllAccessTag>, false, false>) MemorySSA.h:233
    #2 0x1107856f1 in llvm::MemorySSA::removeFromLists(llvm::MemoryAccess*, bool) ilist.h:272
    #3 0x1107ad318 in llvm::MemorySSAUpdater::removeMemoryAccess(llvm::MemoryAccess*, bool) MemorySSAUpdater.cpp:1329
    #4 0x11250504f in (anonymous namespace)::eliminateDeadStoresMemorySSA(llvm::Function&, llvm::AAResults&, llvm::MemorySSA&, llvm::DominatorTree&, llvm::PostDominatorTree&, llvm::TargetLibraryInfo const&) DeadStoreElimination.cpp:1684
    #5 0x11187ab64 in llvm::FPPassManager::runOnFunction(llvm::Function&) LegacyPassManager.cpp:1482
    #6 0x11187b6cb in llvm::FPPassManager::runOnModule(llvm::Module&) LegacyPassManager.cpp:1518
    #7 0x11187c49f in llvm::legacy::PassManagerImpl::run(llvm::Module&) LegacyPassManager.cpp:1583
    #8 0x10db42829 in main opt.cpp:940
    #9 0x7fff7dcae084 in start+0x0 (libdyld.dylib:x86_64+0x17084)

previously allocated by thread T0 here:
    #0 0x11efaf22d in wrap__Znwm+0x7d (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x5222d)
    #1 0x1119bef8b in llvm::User::operator new(unsigned long, unsigned int) User.cpp:124
    #2 0x110782f4f in llvm::MemoryUseOrDef* llvm::MemorySSA::createNewAccess<llvm::BatchAAResults>(llvm::Instruction*, llvm::BatchAAResults*, llvm::MemoryUseOrDef const*) MemorySSA.h:389
    #3 0x11077bee1 in llvm::MemorySSA::buildMemorySSA(llvm::BatchAAResults&) MemorySSA.cpp:1528
    #4 0x11077b66d in llvm::MemorySSA::MemorySSA(llvm::Function&, llvm::AAResults*, llvm::DominatorTree*) MemorySSA.cpp:1235
    #5 0x11078b374 in llvm::MemorySSAWrapperPass::runOnFunction(llvm::Function&) MemorySSA.cpp:1227
    #6 0x11187ab64 in llvm::FPPassManager::runOnFunction(llvm::Function&) LegacyPassManager.cpp:1482
    #7 0x11187b6cb in llvm::FPPassManager::runOnModule(llvm::Module&) LegacyPassManager.cpp:1518
    #8 0x11187c49f in llvm::legacy::PassManagerImpl::run(llvm::Module&) LegacyPassManager.cpp:1583
    #9 0x10db42829 in main opt.cpp:940
    #10 0x7fff7dcae084 in start+0x0 (libdyld.dylib:x86_64+0x17084)

SUMMARY: AddressSanitizer: heap-use-after-free Value.h:485 in (anonymous namespace)::eliminateDeadStoresMemorySSA(llvm::Function&, llvm::AAResults&, llvm::MemorySSA&, llvm::DominatorTree&, llvm::PostDominatorTree&, llvm::TargetLibraryInfo const&)
Shadow bytes around the buggy address:
  0x1c1a000008c0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c1a000008d0: 00 00 00 00 00 fa fa fa fa fa fa fa fa fa 00 00
  0x1c1a000008e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c1a000008f0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x1c1a00000900: 00 00 00 00 00 00 00 00 00 00 fa fa fa fa fa fa
=>0x1c1a00000910: fa fa fd fd fd fd fd fd fd fd[fd]fd fd fd fd fd
  0x1c1a00000920: fd fd fd fd fa fa fa fa fa fa fa fa 00 00 00 00
  0x1c1a00000930: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa fa
  0x1c1a00000940: fa fa fa fa fa fa fd fd fd fd fd fd fd fd fd fd
  0x1c1a00000950: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa
  0x1c1a00000960: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==44493==ABORTING
Stack dump:
0.	Program arguments: /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/opt -basicaa -dse -enable-dse-memoryssa -S 
1.	Running pass 'Function Pass Manager' on module '<stdin>'.
2.	Running pass 'Dead Store Elimination' on function '@test1'
/Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/test/Transforms/DeadStoreElimination/MSSA/Output/crash.ll.script: line 1: 44493 Abort trap: 6           /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/opt -basicaa -dse -enable-dse-memoryssa -S < /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm-project/llvm/test/Transforms/DeadStoreElimination/MSSA/crash.ll

--