[llvm-bugs] [Bug 40432] New: opt crashes with "opt -functionattrs -inline -early-cse -loop-deletion -sroa -ipsccp"

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 23 18:29:59 PST 2019


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

            Bug ID: 40432
           Summary: opt crashes with "opt -functionattrs -inline
                    -early-cse -loop-deletion -sroa -ipsccp"
           Product: libraries
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: cszide at 163.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 21373
  --> https://bugs.llvm.org/attachment.cgi?id=21373&action=edit
.bc file of the source code

$ clang -v
clang version 6.0.0 (tags/RELEASE_600/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir:
/home/jack-zhou/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.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.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.3.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

$ opt -version
LLVM (http://llvm.org/):
  LLVM version 6.0.0
  Optimized build.
  Default target: x86_64-unknown-linux-gnu
  Host CPU: skylake

$clang -O3 -c -emit-llvm  -mllvm -disable-llvm-optzns small.c -o small.bc
-I'path of csmith's runtime'
$ opt  -functionattrs -inline -early-cse -loop-deletion -sroa -ipsccp  
small.bc -o small-opt.bc 
LLVMSymbolizer: error reading file: No such file or directory
#0 0x0000000001a68794 (opt+0x1a68794)
#1 0x0000000001a68a76 (opt+0x1a68a76)
#2 0x00007ff5d2a74890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
#3 0x0000000001974bdb (opt+0x1974bdb)
#4 0x0000000001972a83 (opt+0x1972a83)
#5 0x0000000001602858 (opt+0x1602858)
#6 0x000000000075b292 (opt+0x75b292)
#7 0x00007ff5d1947b97 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b97)
#8 0x000000000074c1b9 (opt+0x74c1b9)
Stack dump:
0.      Program arguments: opt -functionattrs -inline -early-cse -loop-deletion
-sroa -ipsccp small.bc -o small-opt.bc 
1.      Running pass 'Interprocedural Sparse Conditional Constant Propagation'
on module 'small.bc'.
Segmentation fault (core dumped)

The following is the source code of small.c, which is generated by csmith and
reduced by creduce.

#include "csmith.h"
j, 
a, 
e, 
f, 
g;
h;
static *b(*, uint64_t, uint8_t, r, int);
c() {
  int32_t q;
  if (b(k(), j, q, f, g))
    h = safe_add_func_uint32_t_u_u;
}
*b(*d, uint64_t l, uint8_t m, r, n) {
  uint32_t i;
o:
  for (a = 0; a <= 3;)
    for (; 3;)
      ;
  for (; e;) {
    int8_t p;
    for (; 0;)
      goto o;
    i--;
  }
}

-- 
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/20190124/7f705973/attachment.html>


More information about the llvm-bugs mailing list