[llvm-bugs] [Bug 33457] New: wrong code with "opt -early-cse-memssa -instcombine -jump-threading -newgvn" on x86_64-linux-gnu

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 14 08:21:10 PDT 2017


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

            Bug ID: 33457
           Summary: wrong code with "opt -early-cse-memssa -instcombine
                    -jump-threading -newgvn" on x86_64-linux-gnu
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: su at cs.ucdavis.edu
                CC: llvm-bugs at lists.llvm.org

$ clang -v
clang version 5.0.0 (trunk 305363)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/clang-trunk/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.0.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ 
$ clang -O3 -mllvm -disable-llvm-optzns -w -c -emit-llvm -o small.bc small.c
$ 
$ opt -early-cse -instcombine -jump-threading -newgvn -o small-opt.bc small.bc
$ clang small-opt.bc; ./a.out
0
$ 
$ opt -early-cse-memssa -instcombine -jump-threading -newgvn -o small-opt.bc
small.bc
$ clang small-opt.bc  
$ ./a.out
0
Segmentation fault (core dumped)
$ 


--------------------------------------


int printf (const char *, ...); 

int a = 6, b[6], c = -1, d, e;

int main ()
{
  e = 6;
 L:
  printf ("%d\n", b[d]);
  int g = ~(a && e && 0);
  e && 1;
  if (e)
    g = 1;
  int h = ~((g & 8693) ^ c);
  d = h;
  if (h > 1)
    goto L;
  return 0; 
}

-- 
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/20170614/923d29d3/attachment.html>


More information about the llvm-bugs mailing list