[llvm-bugs] [Bug 50279] New: compile-time explosion on valid C code at -O3 on clang trunk version

via llvm-bugs llvm-bugs at lists.llvm.org
Sun May 9 02:15:14 PDT 2021


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

            Bug ID: 50279
           Summary: compile-time explosion on valid C code at -O3 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.

$cat small.c
#include <stdint.h>
int a, c;
uint8_t b;
void d() {
  int32_t e;
  uint16_t *f;
  for (; a;)
    ;
  f = c;
g:
  for (; e; e++) {
    if (*f)
      goto g;
    for (; b; b++)
      ;
  }
}

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

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


Reproduced in Godbolt: https://godbolt.org/z/f9b8Yac6q

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/20210509/f8234cb7/attachment.html>


More information about the llvm-bugs mailing list