https://issues.dlang.org/show_bug.cgi?id=6401
--- Comment #6 from Iain Buclaw <ibuc...@gdcproject.org> --- Somewhat reduced test: --- enum LIBRARY { GTK } struct Linker { static void link(T)(ref T funct, string symbol, LIBRARY[] libraries ...) { } } static this() { static foreach(i; 0 .. 10_000) Linker.link(somefunc, "somefunc", LIBRARY.GTK); } void function() c_somefunc; alias c_somefunc somefunc; --- To prove that this isn't too much of a contrived test, I checked the compile times of other compilers. dmd -O -release -inline | 3 minutes 12 seconds. gdc -O2 -frelease | 6 seconds. ldc -O2 -release | 8 seconds. Actually, the dmd compiler segfaults, I assume because I managed to hit a stack overflow. --