Open
Description
Steps to reproduce
- Save attached main.cpp.txt as cpp file (it is small - 1.7 KB, <100LOC)
- Compile it with debug information and O2/O3 optimizations. I use:
clang++ main.cpp -g -O2
- Uncomment lines one by one and compile again
Expected
Compile is almost instant.
Actually
Compile time grows twice with every uncommented line. Memory usage exceeds 20GB with uncommented line with f24
Last uncommented line | Compile time on my PC, seconds |
---|---|
f16 | 0.945 |
f17 | 1.627 |
f18 | 3.170 |
f19 | 6.121 |
f20 | 12.355 |
f21 | 25.471 |
f22 | 51.952 |
f23 | 1:46.11 |
Environment
$clang++ --version
clang version 19.1.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$uname -a
Linux 6.14.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 09 May 2025 17:36:18 +0000 x86_64 GNU/Linux
Despite I use clang installed as package from archlinux repos, the same issue observed on godbolt site with various clang versions and targets.