[llvm-bugs] [Bug 49670] New: 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 Mar 21 10:43:01 PDT 2021


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

            Bug ID: 49670
           Summary: 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: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: haoxintu at gmail.com
                CC: llvm-bugs at lists.llvm.org

Hi all.

Clang crashes on this valid program under -O3 only. Note that this issue only
occurs in the current trunk version of clang, clang-12 (including) downwards
versions handle this case well.

$cat small.c
#include <stdint.h>
uint8_t a, d, c, b;
void e() {
  int64_t *f = e;
  b = a ? *f : 0;
  int g = 10;
  for (; g; g--) {
    c = 0;
    for (; c <= 30; c++)
      ;
    d = 26;
    for (; d <= 42; d++) {
      int64_t *i = e;
      (a -= (a %= *i) < (c > 31)) || (b /= *i);
    }
  }
}


$clang -w -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
bed9933a461e7b3d0c8c5a8fa770aa1b49802660)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/tuhaoxin/github/llvm-project/build-20210320/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-5d6471.c
clang-13: note: diagnostic msg: /tmp/small-5d6471.sh
clang-13: note: diagnostic msg: 

********************


$clang -v
clang version 13.0.0 (https://github.com/llvm/llvm-project
bed9933a461e7b3d0c8c5a8fa770aa1b49802660)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/tuhaoxin/github/llvm-project/build-20210320/bin
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/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/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
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Candidate multilib: .;@m64
Selected multilib: .;@m64

By the way, I'm not sure if this is the same problem as is reported in
https://bugs.llvm.org/show_bug.cgi?id=47788
and
https://bugs.llvm.org/show_bug.cgi?id=47344
or not.

Thanks,
Haoxin


-- 
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/20210321/49ed701a/attachment.html>


More information about the llvm-bugs mailing list