https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70768

            Bug ID: 70768
           Summary: Increased compilation time
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jamrial at gmail dot com
  Target Milestone: ---

Created attachment 38332
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38332&action=edit
Preprocessed output

The attached preprocessed output (Created from the source using GCC 5, 6 and 7
for the purpose of this ticket) takes almost twice as long to compile using GCC
6.0.1 RC and especially GCC 7.0 compared to GCC 5.3 on a linux x86_64 machine
with 2gb of RAM.


> GCC 5.3.0, ArchLinux package
[jamrial@ArchVM ~]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/gcc/src/gcc-5-20160209/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --enable-libmpx --with-system-zlib --with-isl
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu
--disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object
--enable-linker-build-id --enable-lto --enable-plugin
--enable-install-libiberty --with-linker-hash-style=gnu
--enable-gnu-indirect-function --disable-multilib --disable-werror
--enable-checking=release
Thread model: posix
gcc version 5.3.0 (GCC)

[jamrial@ArchVM ~]$ time c++ -ftemplate-backtrace-limit=0 -Wall -Wextra
-pedantic -Werror -pedantic-errors -Wno-error=deprecated-declarations
-Wno-missing-field-initializers -Wno-unused-parameter -march=haswell -Ofast -g0
-std=gnu++14 -o transform_gcc5.o -c transform_gcc5.ii

real    1m13.380s
user    1m11.920s
sys     0m0.793s

[jamrial@ArchVM ~]$ time c++ -ftemplate-backtrace-limit=0 -Wall -Wextra
-pedantic -Werror -pedantic-errors -Wno-error=deprecated-declarations
-Wno-missing-field-initializers -Wno-unused-parameter -march=haswell -Ofast -g0
-std=gnu++14 -o transform_gcc6.o -c transform_gcc6.ii

real    1m32.820s
user    1m23.093s
sys     0m1.457s

[jamrial@ArchVM ~]$ time c++ -ftemplate-backtrace-limit=0 -Wall -Wextra
-pedantic -Werror -pedantic-errors -Wno-error=deprecated-declarations
-Wno-missing-field-initializers -Wno-unused-parameter -march=haswell -Ofast -g0
-std=gnu++14 -o transform_gcc7.o -c transform_gcc7.ii

real    1m31.705s
user    1m20.663s
sys     0m1.490s


> GCC 6.0.1 RC
[jamrial@ArchVM ~]$ gcc-6 -v
Using built-in specs.
COLLECT_GCC=gcc-6
COLLECT_LTO_WRAPPER=/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/jamrial/gcc-svn/configure --prefix=/usr/local
--libdir=/usr/local/lib --libexecdir=/usr/local/lib
--mandir=/usr/local/share/man --infodir=/usr/local/share/info
--enable-languages=c,c++,lto --enable-shared --enable-threads=posix
--enable-libmpx --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--disable-libssp --enable-gnu-unique-object --enable-linker-build-id
--enable-lto --enable-plugin --enable-install-libiberty
--with-linker-hash-style=gnu --enable-gnu-indirect-function --disable-multilib
--disable-bootstrap --disable-werror
Thread model: posix
gcc version 6.0.1 20160415 (prerelease) (GCC)

[jamrial@ArchVM ~]$ time c++-6 -ftemplate-backtrace-limit=0 -Wall -Wextra
-pedantic -Werror -pedantic-errors -Wno-error=deprecated-declarations
-Wno-missing-field-initializers -Wno-unused-parameter -march=haswell -Ofast -g0
-std=gnu++14 -o transform_gcc5.o -c transform_gcc5.ii

real    1m14.796s
user    1m13.520s
sys     0m0.787s

[jamrial@ArchVM ~]$ time c++-6 -ftemplate-backtrace-limit=0 -Wall -Wextra
-pedantic -Werror -pedantic-errors -Wno-error=deprecated-declarations
-Wno-missing-field-initializers -Wno-unused-parameter -march=haswell -Ofast -g0
-std=gnu++14 -o transform_gcc6.o -c transform_gcc6.ii

real    2m29.020s
user    1m25.240s
sys     0m6.537s

[jamrial@ArchVM ~]$ time c++-6 -ftemplate-backtrace-limit=0 -Wall -Wextra
-pedantic -Werror -pedantic-errors -Wno-error=deprecated-declarations
-Wno-missing-field-initializers -Wno-unused-parameter -march=haswell -Ofast -g0
-std=gnu++14 -o transform_gcc7.o -c transform_gcc7.ii

real    2m27.268s
user    1m23.977s
sys     0m7.167s


> GCC 7.0
[jamrial@ArchVM ~]$ gcc-7 -v
Using built-in specs.
COLLECT_GCC=gcc-7
COLLECT_LTO_WRAPPER=/usr/local/lib/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/jamrial/gcc-svn/configure --prefix=/usr/local
--libdir=/usr/local/lib --libexecdir=/usr/local/lib
--mandir=/usr/local/share/man --infodir=/usr/local/share/info
--enable-languages=c,c++,lto --enable-shared --enable-threads=posix
--enable-libmpx --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--disable-libssp --enable-gnu-unique-object --enable-linker-build-id
--enable-lto --enable-plugin --enable-install-libiberty
--with-linker-hash-style=gnu --enable-gnu-indirect-function --disable-multilib
--disable-bootstrap --disable-werror
Thread model: posix
gcc version 7.0.0 20160422 (experimental) (GCC)

[jamrial@ArchVM ~]$ time c++-7 -ftemplate-backtrace-limit=0 -Wall -Wextra
-pedantic -Werror -pedantic-errors -Wno-error=deprecated-declarations
-Wno-missing-field-initializers -Wno-unused-parameter -march=haswell -Ofast -g0
-std=gnu++14 -o transform_gcc5.o -c transform_gcc5.ii

real    1m57.807s
user    1m56.673s
sys     0m1.057s

[jamrial@ArchVM ~]$ time c++-7 -ftemplate-backtrace-limit=0 -Wall -Wextra
-pedantic -Werror -pedantic-errors -Wno-error=deprecated-declarations
-Wno-missing-field-initializers -Wno-unused-parameter -march=haswell -Ofast -g0
-std=gnu++14 -o transform_gcc6.o -c transform_gcc6.ii

real    2m20.146s
user    2m19.220s
sys     0m0.817s

[jamrial@ArchVM ~]$ time c++-7 -ftemplate-backtrace-limit=0 -Wall -Wextra
-pedantic -Werror -pedantic-errors -Wno-error=deprecated-declarations
-Wno-missing-field-initializers -Wno-unused-parameter -march=haswell -Ofast -g0
-std=gnu++14 -o transform_gcc7.o -c transform_gcc7.ii

real    2m22.689s
user    2m21.773s
sys     0m0.860s


GCC 5.3 performed the best for all three preprocessed files.
GCC 6.0.1 performed about the same as GCC 5.3 using the gcc5 preprocessed file.
It however trashed my HDD a lot trying to compile the preprocessed output from
both GCC 6 and GCC 7, and took longer to finish them. This may hint at
increased RAM usage and explain the odd time values, but i didn't check.
GCC 7 performed the worst across the table, even with the gcc5 preprocessed
file.

Reply via email to