Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 849086 - sys-devel/gcc-11.3.0: ICE when building sys-devel/clang-13.0.1 (CGBuiltin.cpp:8229:1: internal compiler error: maximum number of LRA assignment passes is achieved (30))
Summary: sys-devel/gcc-11.3.0: ICE when building sys-devel/clang-13.0.1 (CGBuiltin.cpp...
Status: RESOLVED FIXED
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: 2022-06-01 21:00 UTC by Laurent Pinchart
Modified: 2023-01-24 10:57 UTC (History)
3 users (show)

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


Attachments
Build log (build.log.xz,42.32 KB, application/x-xz)
2022-06-01 21:00 UTC, Laurent Pinchart
Details
Preprocessed source file (CGBuiltin.cpp.ii.xz,993.39 KB, application/x-xz)
2022-06-06 09:05 UTC, Laurent Pinchart
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Pinchart 2022-06-01 21:00:54 UTC
Created attachment 782114 [details]
Build log

When emerging sys-devel/clang-13.0.1, gcc-11.3.0 produces an internal compiler error:

during RTL pass: reload
/var/tmp/portage/sys-devel/clang-13.0.1/work/clang/lib/CodeGen/CGBuiltin.cpp:8229:1: internal compiler error: maximum number of LRA assignment passes is achieved (30)
 8229 | }
      | ^
0xf3fd97 lra_assign(bool&)
        /var/tmp/portage/sys-devel/gcc-11.3.0/work/gcc-11.3.0/gcc/lra-assigns.c:1694
0xf3a3da lra(_IO_FILE*)
        /var/tmp/portage/sys-devel/gcc-11.3.0/work/gcc-11.3.0/gcc/lra.c:2384
0xef4539 do_reload
        /var/tmp/portage/sys-devel/gcc-11.3.0/work/gcc-11.3.0/gcc/ira.c:5835
0xef4539 execute
        /var/tmp/portage/sys-devel/gcc-11.3.0/work/gcc-11.3.0/gcc/ira.c:6021


The full build log is attached.

# emerge -info
Portage 3.0.30 (python 3.9.12-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-11.3.0, glibc-2.34-r13, 5.15.32-gentoo-r1 x86_64)
=================================================================
System uname: Linux-5.15.32-gentoo-r1-x86_64-Intel-R-_Core-TM-_i7-8550U_CPU_@_1.80GHz-with-glibc2.34
KiB Mem:    16261348 total,   8612060 free
KiB Swap:   16777212 total,  16777212 free
Timestamp of repository gentoo: Tue, 31 May 2022 16:30:01 +0000
Head commit of repository gentoo: 242122bac22ac2413031d74623afbdfb1b13ea50
Head commit of repository matrix: c2317a8cb57765e3dc7a22a94f973e158e367cac

sh bash 5.1_p16
ld GNU ld (Gentoo 2.37_p1 p2) 2.37
ccache version 4.5.1 [disabled]
app-misc/pax-utils:        1.3.3::gentoo
app-shells/bash:           5.1_p16::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.34.0-r9::gentoo
dev-lang/python:           2.7.18_p15::gentoo, 3.9.12::gentoo, 3.10.4::gentoo
dev-lang/rust:             1.59.0::gentoo
dev-util/ccache:           4.5.1::gentoo
dev-util/cmake:            3.22.4::gentoo
dev-util/meson:            0.61.4-r2::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/openrc:           0.44.10::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.13-r1::gentoo, 2.71-r1::gentoo
sys-devel/automake:        1.13.4-r2::gentoo, 1.16.5::gentoo
sys-devel/binutils:        2.37_p1-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           9.0.1::local, 13.0.0::gentoo
sys-devel/gcc:             8.4.0-r2::gentoo, 9.3.0-r2::gentoo, 10.3.1_p20211126::gentoo, 11.3.0::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.6-r6::gentoo
sys-devel/lld:             13.0.1::gentoo
sys-devel/llvm:            9.0.1::local, 13.0.1::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.34-r13::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24

local
    location: /usr/local/portage
    masters: gentoo

matrix
    location: /var/db/repos/matrix
    sync-type: git
    sync-uri: https://github.com/gentoo/matrix
    masters: gentoo

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /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.0/ext-active/ /etc/php/cgi-php8.0/ext-active/ /etc/php/cli-php8.0/ext-active/ /etc/php/fpm-php8.0/ext-active/ /etc/php/phpdbg-php8.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=native"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY 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"
FCFLAGS="-O2 -pipe -march=native"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=native"
GENTOO_MIRRORS="http://ftp.free.fr/mirrors/ftp.gentoo.org/ http://gentoo.mirrors.ovh.net/gentoo-distfiles/"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en-GB fi fr"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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"
SHELL="/bin/bash"
USE="X a52 aac acl acpi activities alsa amd64 apache2 apng avahi bash-completion bluetooth branding bzip2 cairo caps cdda cdr cli crypt cups dbus declarative dri dts dvd dvdr elogind encode exif fam flac fontconfig fortran gd gdbm gif gles2 gpg gpm gui iconv icu ipv6 jingle jpeg jpeg2k kde kwallet laptop lcms libglvnd libnotify libtirpc mad mmx mmxext mng mp3 mp4 mpeg mtp multilib musicbrainz mysql ncurses networkmanager nls nptl ogg openexr opengl openmp pam pango pcre pdf php pkcs11 plasma png policykit postgres ppds pulseaudio python qml qt5 readline redland sasl sdl seccomp semantic-desktop sip speex spell split-usr sqlite3 sse sse2 sse3 sse4 ssl ssse3 startup-notification svg theora threads tiff tkip touchpad truetype udev udisks unicode upower usb v4l v4l2 vaapi vim-syntax vorbis wav wayland webp widgets x264 xattr xcb xcomposite xinerama xml xmp xpm xsl xv xvid xvmc zeroconf zlib" ABI_X86="64" ADA_TARGET="gnat_2020" 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" APACHE2_MPMS="worker" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3 sse4" 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="evdev libinput synaptics" KERNEL="linux" L10N="en en-GB fi fr" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" QEMU_SOFTMMU_TARGETS="arm i386 x86_64" QEMU_USER_TARGETS="arm i386 x86_64" USERLAND="GNU" VIDEO_CARDS="intel" 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, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-01 21:55:04 UTC
Is it reproducible?

Could you follow ttps://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide together?
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-02 03:34:03 UTC
Could be related to https://gcc.gnu.org/bugzilla//show_bug.cgi?id=104637.
Comment 3 Laurent Pinchart 2022-06-02 06:08:24 UTC
(In reply to Sam James from comment #1)
> Is it reproducible?
> 
> Could you follow ttps://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide
> together?

It's unfortunately reproducible :-)

I'll follow the ICE reporting guide and provide the extra information.
Comment 4 Laurent Pinchart 2022-06-06 09:05:29 UTC
Created attachment 783119 [details]
Preprocessed source file

Compiler command line to reproduce the issue:

LANG=C /usr/bin/x86_64-pc-linux-gnu-g++-11.3.0 -O2 -march=skylake -std=c++14 -o CGBuiltin.cpp.o -c CGBuiltin.cpp.ii
Comment 5 Laurent Pinchart 2022-06-06 09:07:44 UTC
I've compiled the preprocessed source with gcc 12.1.0, and the ICE is gone. It would still be nice to get the fix backported to gcc 11 though, especially given that gcc 12 isn't stable on amd64 yet.
Comment 6 tt_1 2022-06-21 05:45:18 UTC
upstream patches for this were backported to gcc-10/11 branch
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-21 06:02:33 UTC
Thanks both. I've been wondering what to do here, given I'm likely to keyword GCC 12 this week if the 0ad ICE bug gets fixed (and I hope it will: bug 847601).

My very provisional plan is to push a fixed 11.3.0 (this patch, maybe one or two others, or just keyword one of the snapshots) at the same time as 12.x so that only folks who have 12 masked (fairly common to do for major versions) have to build it, rather than doing e.g. fixed 11.3.0 today in ~arch, then in a few days everyone in ~arch has to build 12.1.0_p*.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-26 04:34:16 UTC
12.1.1_p20220625 now keyworded. Bit tired out from the work for that but I'll get around to backporting the 11 patch soon.