http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60291
Bug ID: 60291 Summary: slow compile times for any mode (-O0/-O1/-O2) on large .c source file (30MBs) Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: slyfox at inbox dot ru Created attachment 32182 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32182&action=edit ghc14232_3.hc.i.bz2 - compressed source file (30MBs uncompressed) GHC (glasgow haskell compiler) in it's portable mode generates intermediate .C source files. Sometimes they are really large: 20-100 MB. Even on core-i7 building such files takes: 3-5 minutes. On slower boxes/arches things are worse and go up to 20-60 minutes. clang does not seem to have such problems [1]. gcc version should not be very relevant. Time test are for [2]. If the problem is hard to fix in gcc what options would you suggest to enable to get sane build times? -fno-unit-at-a-time does not seem to help. Thanks! [1]: [sf] /tmp/__z:time gcc -O0 -Wno-ignored-attributes -c ghc14232_3.hc.i -o gcc.o real 5m19.975s user 5m18.403s sys 0m0.629s [sf] /tmp/__z:time gcc -O1 -Wno-ignored-attributes -c ghc14232_3.hc.i -o gcc.o real 3m0.557s user 2m58.496s sys 0m0.623s [sf] /tmp/__z:time gcc -O2 -Wno-ignored-attributes -c ghc14232_3.hc.i -o gcc.o real 3m21.315s user 3m19.691s sys 0m0.550s [sf] /tmp/__z:time clang -O0 -Wno-ignored-attributes -c ghc14232_3.hc.i -o clang.o real 0m19.661s user 0m19.356s sys 0m0.234s [sf] /tmp/__z:time clang -O1 -Wno-ignored-attributes -c ghc14232_3.hc.i -o clang.o real 0m49.612s user 0m49.145s sys 0m0.295s [sf] /tmp/__z:time clang -O2 -Wno-ignored-attributes -c ghc14232_3.hc.i -o clang.o real 0m48.991s user 0m48.539s sys 0m0.278s [2]: Using built-in specs. COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2/gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.2/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /subvolumes/var_tmp/portage/sys-devel/gcc-4.8.2-r1/work/gcc-4.8.2/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/include/g++-v4 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.8.2-r1 p1.4-ssptest, pie-0.5.9-ssptest' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --enable-lto --without-cloog Thread model: posix gcc version 4.8.2 (Gentoo 4.8.2-r1 p1.4-ssptest, pie-0.5.9-ssptest)