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

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 11 07:18:00 PDT 2021


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

            Bug ID: 50302
           Summary: compile-time explosion 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.

I guess this is not a dup of bug 50279, because the two test programs look
totally different, so I file a new report here. Please close this if they are
caused by the same issues.


$cat small.c
#include <stdint.h>
void a() {
  int b = 0;
  uint32_t c = 0;
  int64_t d;
  for (; d; d += 10)
    c = d;
  uint16_t e = 0;
  uint8_t f = a;
  uint8_t *g;
  if (e) {
    static int j;
    int32_t *i = &j;
    if (0) {
    k:
      if (*g || (*i &= 7))
        goto k;
      g = e;
      goto k;
    }
    f = &j;
  }
  b &&f;
  g = c;
  goto k;
}


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

$clang -v
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
ea64200b6197d8db97a11db15a5906fc1eb5ef4a)
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/fPoabP7od

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/20210511/1ba176d6/attachment.html>


More information about the llvm-bugs mailing list