[llvm-bugs] [Bug 51762] New: compile-time explosion at -O1 on clang trunk version

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Sep 5 18:23:42 PDT 2021


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

            Bug ID: 51762
           Summary: compile-time explosion at -O1 on clang trunk version
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            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.

The following valid program makes the trunk version of clang hang at -O1.

$cat small.c
#include <stdint.h>
int a, c, d, e, f;
int16_t b;
void g() {
  uint64_t i;
  uint64_t *r = &i;
  int16_t j;
  uint64_t *k;
  uint64_t **l = &r;
  for (; *k;) {
    int32_t *m = d;
    if (e ? **l = c : 0) {
      int16_t n;
      int32_t o = d;
      if (a)
        m = *l;
      for (n = 4; n; *m = o)
        ;
      int16_t *p = j;
    q:
      j = *p;
    }
  }
  if (*r /= (b % *r || 0 == *r) % (f += d >= b))
    goto q;
}

$clang -w -O1 small.c
//endless compiling

$clang -v
clang version 14.0.0 (https://github.com/llvm/llvm-project
fa69ccd189694d0b992323738443ac05a2bcb9ca)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/haoxin/haoxin-data/compilers/llvm-project/build/bin
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
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

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/20210906/95dc68aa/attachment.html>


More information about the llvm-bugs mailing list