[llvm-bugs] [Bug 36635] New: opt crashes with "opt -gvn-hoist": Assertion `dominates(MD, U) && "Memory Def does not dominate it's uses"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 7 11:03:58 PST 2018


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

            Bug ID: 36635
           Summary: opt crashes with "opt -gvn-hoist": Assertion
                    `dominates(MD, U) && "Memory Def does not dominate
                    it's uses"' failed
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: Vsevolod.Livinskij at frtk.ru
                CC: llvm-bugs at lists.llvm.org

Created attachment 20016
  --> https://bugs.llvm.org/attachment.cgi?id=20016&action=edit
Reproducer.

opt with -O3 -gvn-hoist fails assertion Assertion `dominates(MD, U) && "Memory
Def does not dominate it's uses"' failed.

Don't pay attention to weird form of ternary operator. It occurred during
automated reduction. Original full reproducer (see attachment) is a valid c++
code without this form, and it also fails with the same assertion.
P.S. if you know how to disable this GCC extension in clang, I would appreciate
if you tell me.

Reproducer:
>$ cat repr.cpp
int a, b, d;
char c, e, f, g;
void h() {
  if (!!b ?: a && c)
    if (f) {
      (b ? 0 : a && c) ? b ?: a && 0 : (b ?: a && c) || 0 & e;
      d = 0;
      b ?: a &&c || e;
    }
  if ((b ? 0 : a && c) || ~e)
    g = 905728;
}

Error:
>$ clang++  -std=c++11 -w -O3 -Xclang -disable-llvm-optzns -emit-llvm -c -o repr.bc repr.cpp ; opt  -O3 -o repr.ll repr.bc -gvn-hoist
opt: llvm/llvm-trunk/lib/Analysis/MemorySSA.cpp:1694: void
llvm::MemorySSA::verifyDomination(llvm::Function&) const: Assertion
`dominates(MD, U) && "Memory Def does not dominate it's uses"' failed.
LLVMSymbolizer: error reading file: No such file or directory
#0 0x000000000143b0fa (opt+0x143b0fa)
#1 0x00000000014391de (opt+0x14391de)
#2 0x0000000001439342 (opt+0x1439342)
#3 0x00007f8826ef4100 __restore_rt (/lib64/libpthread.so.0+0xf100)
#4 0x00007f8825a705f7 __GI_raise (/lib64/libc.so.6+0x355f7)
#5 0x00007f8825a71ce8 __GI_abort (/lib64/libc.so.6+0x36ce8)
#6 0x00007f8825a69566 __assert_fail_base (/lib64/libc.so.6+0x2e566)
#7 0x00007f8825a69612 (/lib64/libc.so.6+0x2e612)
#8 0x0000000000a1fddc (opt+0xa1fddc)
#9 0x0000000000a1fe19 (opt+0xa1fe19)
#10 0x0000000000f273c9 (opt+0xf273c9)
#11 0x0000000000f2a8ba (opt+0xf2a8ba)
#12 0x0000000000f2aa3c (opt+0xf2aa3c)
#13 0x0000000000f2b2df (opt+0xf2b2df)
#14 0x00000000005ea0ad (opt+0x5ea0ad)
#15 0x00007f8825a5cb15 __libc_start_main (/lib64/libc.so.6+0x21b15)
#16 0x0000000000628f09 (opt+0x628f09)
Stack dump:
0.      Program arguments: opt -O3 -o repr.ll repr.bc -gvn-hoist
1.      Running pass 'Function Pass Manager' on module 'repr.bc'.
Aborted (core dumped)

LLVM version:
>$ clang++ -v
clang version 7.0.0 (trunk 326547)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: llvm/bin-trunk/bin
Found candidate GCC installation: /usr/lib/gcc/i686-redhat-linux/4.8.2
Found candidate GCC installation: /usr/lib/gcc/i686-redhat-linux/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64

-- 
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/20180307/70fc3960/attachment.html>


More information about the llvm-bugs mailing list