[llvm-bugs] [Bug 35126] New: wrong code with opt "-instcombine -sroa -newgvn"

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Oct 29 20:02:12 PDT 2017


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

            Bug ID: 35126
           Summary: wrong code with opt "-instcombine -sroa -newgvn"
           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

Tested with trunk rev. 316871. 

$ clangpolly -v
clang version 6.0.0 (http://llvm.org/git/clang.git
68e041468bfb4a364acdfa32abb0c7e38cfb938e) (http://llvm.org/git/llvm.git
986395e8cd168305bcf7a9463fb0fc9696218f0b)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/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
$ 
$ clangpolly -O0 small.c; ./a.out
$ 
$ clangpolly -O3 -mllvm -disable-llvm-optzns -c -emit-llvm -o small.bc -w
small.c
$ optpolly -instcombine -sroa -newgvn -o small-opt.bc small.bc
$ clangpolly small-opt.bc
$ ./a.out
Floating point exception (core dumped)
$ 


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


int a = -1, b;

int main ()
{
  int d = ~a;
  if (d < 1)
    d = a;
  int e = ~d;
  if (e > d)
    e = d;
  b = ~e / e;
  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/20171030/50cd428f/attachment.html>


More information about the llvm-bugs mailing list