[llvm-bugs] [Bug 50594] New: clang crashes on valid code at -O3 on x86_64-linux-gnu: fatal error: error in backend: Instruction Combining seems stuck in an infinite loop after 100 iterations

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jun 6 06:19:41 PDT 2021


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

            Bug ID: 50594
           Summary: clang crashes on valid code at -O3 on
                    x86_64-linux-gnu: fatal error: error in backend:
                    Instruction Combining seems stuck in an infinite loop
                    after 100 iterations
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: zhendong.su at inf.ethz.ch
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, pengfei.wang at intel.com,
                    spatel+llvm at rotateright.com

[512] % clangtk -v
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
c2ab3d2c85c8af4483f05d8bb702891cd3682969)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /local/suz-local/opfuzz/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
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.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
[513] % 
[513] % clangtk -O2 small.c; ./a.out
[514] % 
[514] % clangtk -O3 small.c
fatal error: error in backend: Instruction Combining seems stuck in an infinite
loop after 100 iterations.
clang-13: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
c2ab3d2c85c8af4483f05d8bb702891cd3682969)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /local/suz-local/opfuzz/bin
clang-13: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg: /tmp/small-d1ac30.c
clang-13: note: diagnostic msg: /tmp/small-d1ac30.sh
clang-13: note: diagnostic msg: 

********************
[515] % 
[515] % cat small.c
int printf (const char *, ...);
int d, f, g, h;
static int e = 1;
int main() {
  long long l = 0;
  int m = 1, i, j;
  for (i = 0; i < 4; i++)
    for (j = 0; j < 10; j++) {
      int n;
      h = m;
      n = g = d * h * l >> f;
      m = e * f;
      l = ~n & d * m & f;
      if (!e) {
        printf("%d\n", g);
        continue;
      }
      if (h < 1) {
        printf("%lld\n", l);
        continue;
      }
      f = m = h;
      l = n;
    }
  for (e = 0; e < 2; 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/20210606/393dd538/attachment-0001.html>


More information about the llvm-bugs mailing list