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

            Bug ID: 41625
           Summary: Clang uses >8GB of RAM to build a PCH for a simple
                    header
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: poletti.ma...@gmail.com
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

Compiling a PCH for the following code:

struct Wrapper {
   struct X {};
   using Y = X(X(X(X(X(X(X(X(X(X(X(X(X(X(X(X())))))))))))))));
};

With a command like:

clang-8 -x c++-header file.h -o file.pch

Uses several GBs of RAM (>8).

If you want to reproduce, you might want to set a RAM limit in the current
shell, e.g. with "ulimit -Sv 8000000" otherwise your PC might start swapping
and/or become unresponsive.

I tested the following versions of Clang (on Ubuntu Linux):

8.0.0: affected
7.0.1: affected
6.0.1: NOT affected

So this seems to be a regression in Clang 7.x.

The above example is a minimized version of real code in
https://github.com/google/fruit, where building PCHs now fails in Travis CI
with OOM errors.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to