Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 904481 - sys-devel/gcc:13 compile time increase by 50% with lto
Summary: sys-devel/gcc:13 compile time increase by 50% with lto
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-17 16:52 UTC by Cănărău Constantin
Modified: 2023-04-19 11:04 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cănărău Constantin 2023-04-17 16:52:37 UTC
sys-devel/gcc:13[lto] compile time increase from about 30 minutes to 45 minutes on my system.
I do not know if this is a bug or not, but this happened at the beging of 13.0.0_pre versions and then dissapeared. Now longer compile time is back.

As gcc 13.1 release candidate is almost here, maybe it is a good thing to ask if is a bug or the new normal behaviour. 

genlop -t sys-devel/gcc

     Wed Jan 11 18:25:26 2023 >>> sys-devel/gcc-13.0.0_pre20230108
       merge time: 23 minutes and 39 seconds.

     Thu Jan 12 18:47:57 2023 >>> sys-devel/gcc-13.0.0_pre20230108
       merge time: 23 minutes and 32 seconds.

     Thu Jan 12 21:14:06 2023 >>> sys-devel/gcc-13.0.0_pre20230108
       merge time: 23 minutes and 39 seconds.

     Mon Jan 16 13:32:06 2023 >>> sys-devel/gcc-13.0.0_pre20230115
       merge time: 24 minutes and 58 seconds.

     Mon Jan 16 14:10:06 2023 >>> sys-devel/gcc-13.0.0_pre20230115
       merge time: 30 minutes and 47 seconds.

     Thu Jan 26 21:51:41 2023 >>> sys-devel/gcc-13.0.1_pre20230122
       merge time: 30 minutes and 29 seconds.

     Mon Jan 30 16:45:56 2023 >>> sys-devel/gcc-13.0.1_pre20230129-r1
       merge time: 31 minutes and 22 seconds.

     Thu Feb  2 22:41:06 2023 >>> sys-devel/gcc-13.0.1_pre20230129-r1
       merge time: 30 minutes and 44 seconds.

     Mon Feb  6 12:29:56 2023 >>> sys-devel/gcc-13.0.1_pre20230205
       merge time: 30 minutes and 3 seconds.

     Tue Feb  7 00:13:06 2023 >>> sys-devel/gcc-13.0.1_pre20230205-r1
       merge time: 30 minutes and 16 seconds.

     Mon Feb 13 15:05:06 2023 >>> sys-devel/gcc-13.0.1_pre20230212
       merge time: 36 minutes and 22 seconds.

     Mon Feb 20 17:32:53 2023 >>> sys-devel/gcc-13.0.1_pre20230219
       merge time: 30 minutes and 25 seconds.

     Mon Feb 27 15:23:25 2023 >>> sys-devel/gcc-13.0.1_pre20230226
       merge time: 29 minutes and 49 seconds.

     Mon Mar  6 19:12:13 2023 >>> sys-devel/gcc-13.0.1_pre20230305
       merge time: 30 minutes and 38 seconds.

     Mon Mar 13 22:00:42 2023 >>> sys-devel/gcc-13.0.1_pre20230312
       merge time: 31 minutes and 48 seconds.

     Tue Mar 14 17:47:18 2023 >>> sys-devel/gcc-13.0.1_pre20230312-r1
       merge time: 31 minutes and 1 second.

     Mon Mar 27 12:34:33 2023 >>> sys-devel/gcc-13.0.1_pre20230326
       merge time: 30 minutes and 50 seconds.

     Wed Mar 29 16:44:43 2023 >>> sys-devel/gcc-13.0.1_pre20230326-r1
       merge time: 31 minutes and 1 second.

     Mon Apr  3 19:02:11 2023 >>> sys-devel/gcc-13.0.1_pre20230402
       merge time: 30 minutes and 53 seconds.

     Wed Apr  5 12:09:22 2023 >>> sys-devel/gcc-13.0.1_pre20230402-r1
       merge time: 30 minutes and 24 seconds.

     Mon Apr 10 12:08:05 2023 >>> sys-devel/gcc-13.0.1_pre20230409
       merge time: 30 minutes and 53 seconds.

     Tue Apr 11 11:48:28 2023 >>> sys-devel/gcc-13.0.1_pre20230409-r1
       merge time: 47 minutes and 3 seconds.

     Wed Apr 12 16:41:57 2023 >>> sys-devel/gcc-13.0.1_pre20230409-r3
       merge time: 52 minutes and 12 seconds.

     Thu Apr 13 16:17:44 2023 >>> sys-devel/gcc-13.0.1_pre20230409-r4
       merge time: 47 minutes and 20 seconds.

     Mon Apr 17 13:41:06 2023 >>> sys-devel/gcc-13.0.1_pre20230416
       merge time: 47 minutes and 25 seconds.



emerge --info sys-devel/gcc
Portage 3.0.46 (python 3.11.3-final-0, default/linux/amd64/23.0/no-multilib/systemd, gcc-13, glibc-2.37-r2, 6.2.11-gentoo-costel x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.2.11-gentoo-costel-x86_64-AMD_Ryzen_9_7900X_12-Core_Processor-with-glibc2.37
KiB Mem:    31950108 total,  29807232 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Mon, 17 Apr 2023 06:45:01 +0000
Head commit of repository gentoo: 0142a2a06dd1d5ebcf179c2749daf97102417fa6
sh bash 5.2_p15-r2
ld GNU ld (Gentoo 2.40 p4) 2.40.0
distcc 3.4 x86_64-pc-linux-gnu [disabled]
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p15-r2::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.36.0-r2::gentoo
dev-lang/python:           3.11.3::gentoo
dev-lang/rust:             1.68.2::gentoo
dev-util/cmake:            3.26.3::gentoo
dev-util/meson:            1.1.0::gentoo
sys-apps/baselayout:       2.13-r1::gentoo
sys-apps/sandbox:          2.30-r1::gentoo
sys-apps/systemd:          253.3::gentoo
sys-devel/autoconf:        2.13-r8::gentoo, 2.71-r6::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.40-r4::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           15.0.7-r1::gentoo, 16.0.1::gentoo
sys-devel/gcc:             13.0.1_pre20230416::gentoo
sys-devel/gcc-config:      2.10::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             15.0.7::gentoo
sys-devel/llvm:            15.0.7::gentoo, 16.0.1::gentoo
sys-devel/make:            4.4.1::gentoo
sys-kernel/linux-headers:  6.2::gentoo (virtual/os-headers)
sys-libs/glibc:            2.37-r2::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.ro.gentoo.org/gentoo-portage/
    priority: -1000
    volatile: False
    sync-rsync-verify-max-age: 24
    sync-rsync-vcs-ignore: true
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 8
    sync-rsync-extra-opts: --human-readable --delete-before --progress --new-compress

added
    location: /var/db/repos/added
    masters: gentoo
    priority: 10
    volatile: False

crossdev
    location: /var/db/repos/crossdev
    masters: gentoo
    priority: 10
    volatile: True

newer
    location: /var/db/repos/newer
    masters: gentoo
    priority: 10
    volatile: False

pi
    location: /var/db/repos/pi
    masters: gentoo
    priority: 100
    volatile: False

Installed sets: @crossdev, @desktop, @dev, @minimal, @xfce
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -pipe -g0 -march=native -fipa-pta -fno-semantic-interposition -fno-plt -fgraphite-identity -floop-nest-optimize -flto=auto -flto-compression-level=9 -fdevirtualize-at-ltrans"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.2/ext-active/ /etc/php/cgi-php8.2/ext-active/ /etc/php/cli-php8.2/ext-active/ /etc/php/fpm-php8.2/ext-active/ /etc/php/phpdbg-php8.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d"
CXXFLAGS="-O3 -pipe -g0 -march=native -fipa-pta -fno-semantic-interposition -fno-plt -fgraphite-identity -floop-nest-optimize -flto=auto -flto-compression-level=9 -fdevirtualize-at-ltrans"
DISTDIR="/mnt/linux/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=6 --load-average=30 --keep-going --with-bdeps=y --complete-graph --quiet-build=n --autounmask-write"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live candy cgroup collision-protect config-protect-if-modified distlocks fail-clean fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news nodoc noinfo parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-filter unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.romnet.org/gentoo/ http://distfiles.gentoo.org/"
INSTALL_MASK="/usr/share/locale -/usr/share/locale/ro -/usr/share/locale/en -/usr/share/locale/en_US"
LANG="ro_RO.UTF-8"
LC_ALL="ro_RO.UTF8"
LDFLAGS="-Wl,-O1,--sort-common,--hash-style=gnu,--enable-new-dtags,--as-needed -flto=auto"
LEX="flex"
LINGUAS="en ro"
MAKEOPTS="-j24 --load-average=30"
PKGDIR="/var/cache/binpkgs"
PORTAGE_COMPRESS="zstd"
PORTAGE_COMPRESS_FLAGS="-T0 -19"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--human-readable --delete-before --progress --new-compress"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
RUSTFLAGS="-C debuginfo=0 -C opt-level=3 -C target-cpu=znver3"
SHELL="/bin/bash"
USE="X aac acpi aes alsa amd64 avx avx2 avx512bw avx512cd avx512dq avx512f avx512vbmi avx512vl bluetooth branding bzip2 cairo crypt dbus dvb f16c fam ffmpeg flac fma3 gdbm gif gpm gtk gtk3 gtk4 iconv icu ipv6 jpeg jpeg2k libglvnd libtirpc lm-sensors lto lz4 lzma mmx mmxext mp3 ncurses networkmanager nls nptl ogg opengl openmp pam pango pclmul pcre pdf pgo png policykit popcnt portaudio pulseaudio rdrand readline sdl seccomp server sha sndio sse sse2 sse3 sse4_1 sse4_2 sse4a ssl ssse3 systemd test-rust truetype udev udisks unicode upower usb v4l vaapi vhosts vorbis vulkan webp x264 zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2021" ALSA_CARDS="hda-intel usb-audio" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 avx512f avx512dq avx512cd avx512bw avx512vl avx512vbmi f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en ro" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="BPF X86 AMDGPU" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" NGINX_MODULES_HTTP="access auth_basic autoindex brotli browser charset fastcgi geoip2 gunzip gzip limit_conn limit_req memcached realip referer rewrite split_clients ssi sub userid naxsi" NGINX_MODULES_STREAM="access geoip2 limit_conn realip" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" QEMU_SOFTMMU_TARGETS="x86_64 aarch64" QEMU_USER_TARGETS="aarch64" RUBY_TARGETS="ruby30" SANE_BACKENDS="bh cardscan coolscan coolscan2 coolscan3 pie pieusb" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS

=================================================================
                        Package Settings
=================================================================

sys-devel/gcc-13.0.1_pre20230416::gentoo was built with the following:
USE="(cxx) (default-stack-clash-protection) (default-znow) graphite lto nls nptl openmp pgo (pie) sanitize ssp zstd -ada (-cet) (-custom-cflags) -d -debug -doc (-fixed-point) -fortran -go -hardened (-ieee-long-double) -jit (-libssp) (-multilib) -objc -objc++ -objc-gc (-pch) -rust -systemtap -test -valgrind -vanilla -vtv"
CFLAGS="-pipe -g0 -march=native -O2"
CXXFLAGS="-pipe -g0 -march=native -O2"
FEATURES="nodoc usersync binpkg-docompress ipc-sandbox fixlafiles protect-owned candy unknown-features-warn multilib-strict sfperms userfetch network-sandbox binpkg-logs sandbox preserve-libs noinfo cgroup strict buildpkg-live qa-unresolved-soname-deps parallel-fetch distlocks binpkg-dostrip news unmerge-orphans merge-sync collision-protect unknown-features-filter parallel-install pid-sandbox config-protect-if-modified fail-clean userpriv binpkg-multi-instance usersandbox unmerge-logs assume-digests"
LDFLAGS="-Wl,-O1,--sort-common,--hash-style=gnu,--enable-new-dtags,--as-needed"


Reproducible: Always
Comment 1 Stephan Hartmann (RETIRED) gentoo-dev 2023-04-17 19:09:39 UTC
Could be because of:
https://gitweb.gentoo.org/repo/gentoo.git/commit/eclass/toolchain.eclass?id=3f9a5248fb796417d63ae1c1234b534a88f22f14

It configures gcc with --enable-checking=yes,extra, which enables more checking logic.
Comment 3 Cănărău Constantin 2023-04-17 20:59:55 UTC
With no --enable-checking in configure phase time went down to 42 minutes. 
I suppose will have to wait to be officially released and see how things will going.

 * /bin/sh /var/tmp/portage/sys-devel/gcc-13.0.1_pre20230416/work/gcc-13-20230416/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/13 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/13/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/13 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/13/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/13/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/13/python --enable-languages=c,c++ --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --disable-libunwind-exceptions --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion=Gentoo 13.0.1_pre20230416 p9 --with-gcc-major-version-only --disable-esp --enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --with-multilib-list=m64 --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libssp --disable-libada --disable-cet --disable-systemtap --disable-valgrind-annotations --disable-vtable-verify --disable-libvtv --with-zstd --with-isl --disable-isl-version-check --enable-default-pie --enable-default-ssp --with-build-config=bootstrap-lto
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-04-17 21:06:07 UTC
(In reply to Cănărău Constantin from comment #3)
> With no --enable-checking in configure phase time went down to 42 minutes. 
> I suppose will have to wait to be officially released and see how things
> will going.
> 

The RC (due out tomorrow) will be built with --enable-checking=release as usual because it's now a 'prerelease' rather than 'experimental'.

You can set GCC_CHECKS_LIST="release" locally if you want for all GCCs but I don't recommend that. We've found a number of surprising bugs so far with the enhanced checking.
Comment 5 Cănărău Constantin 2023-04-19 11:01:15 UTC
     Wed Apr 19 13:56:10 2023 >>> sys-devel/gcc-13.0.1_pre20230419
       merge time: 30 minutes and 58 seconds.

With --enable-checking=release everything is returning to normal. 
Sorry for the noise, but compiling time variation was big.

Thank you!
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-04-19 11:04:22 UTC
(In reply to Cănărău Constantin from comment #5)
>      Wed Apr 19 13:56:10 2023 >>> sys-devel/gcc-13.0.1_pre20230419
>        merge time: 30 minutes and 58 seconds.
> 
> With --enable-checking=release everything is returning to normal. 
> Sorry for the noise, but compiling time variation was big.
> 
> Thank you!

No worries, I'd rather you tell us to be safe :)

I didn't take the decision to change it lightly, either, but we've found a few substantial bugs as a result which could've led to miscompilation, so it's been worth it.

If you want to override it, you can set GCC_CHECKS_LIST="release" in /etc/portage/env (no need for EXTRA_ECONF, even).