Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 822690 - <sys-devel/gcc-11.2.1_p20220115: ICE (internal compiler error: in gimple_build_call, at gimple.c:267) when building dev-java/openjdk-17
Summary: <sys-devel/gcc-11.2.1_p20220115: ICE (internal compiler error: in gimple_buil...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://gcc.gnu.org/bugzilla/show_bug...
Whiteboard:
Keywords:
Depends on: 833357
Blocks:
  Show dependency tree
 
Reported: 2021-11-09 14:51 UTC by Alexander Weber
Modified: 2022-02-27 06:16 UTC (History)
9 users (show)

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


Attachments
build.log (build.log,906.38 KB, text/x-log)
2021-11-09 14:54 UTC, Alexander Weber
Details
work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/hotspot/variant-server/libjvm/objs/archiveBuilder.ii (archiveBuilder.ii.gz,210.27 KB, application/gzip)
2021-11-09 22:02 UTC, Alexander Weber
Details
emerge --info file (emerge.info,18.68 KB, text/plain)
2021-12-17 17:34 UTC, Frank Noack
Details
build.log part 1 (split.build.log.01,700.00 KB, application/octet-stream)
2021-12-17 17:45 UTC, Frank Noack
Details
build.log part2 (split.build.log.02,411.78 KB, text/plain)
2021-12-17 17:46 UTC, Frank Noack
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Weber 2021-11-09 14:51:18 UTC
On my AMD A8-7600 the openjdk-17 does not build. Did not tried another version.

On my newer Intel systems the issue does not appear.

Reproducible: Always

Actual Results:  
File /var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/make-support/failure-logs/hotspot_variant-server_libjvm_objs_archiveBuilder.o.log:

during GIMPLE pass: aprefetch
/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/share/cds/archiveBuilder.cpp: In constructor 'ArchiveBuilder::ArchiveBuilder()':
/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/share/cds/archiveBuilder.cpp:146:1: internal compiler error: in gimple_build_call, at gimple.c:267
  146 | ArchiveBuilder::ArchiveBuilder() :
      | ^~~~~~~~~~~~~~
0x171449f internal_error(char const*, ...)
	???:0
0x63922f fancy_abort(char const*, int, char const*)
	???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.



# emerge --info
Portage 3.0.28 (python 3.9.7-final-0, default/linux/amd64/17.1/desktop, gcc-11.2.0, glibc-2.33-r7, 5.10.61-gentoo x86_64)
=================================================================
System uname: Linux-5.10.61-gentoo-x86_64-AMD_A8-7600_Radeon_R7,_10_Compute_Cores_4C+6G-with-glibc2.33
KiB Mem:    16334256 total,  10469704 free
KiB Swap:   16777212 total,  16777212 free
Timestamp of repository gentoo: Tue, 09 Nov 2021 12:00:01 +0000
Head commit of repository gentoo: 9624488cb6f6a0708850a2cff8e8f71cbc74f2b4
Head commit of repository bell07: 7b8e52a0aa01930e4a2660e735f5bcd8ee66d4df

Head commit of repository kubler: e3547c6a6898ca7308c94e14678c96938dea7751

Timestamp of repository menelkir: Tue, 09 Nov 2021 10:53:25 +0000
Head commit of repository menelkir: 3f7b1abff36fe70d13c7a33e348cee5d704e4b13

Timestamp of repository steam-overlay: Tue, 09 Nov 2021 10:53:07 +0000
Head commit of repository steam-overlay: b21d724e69a176a398cae2db70172cb9dfede48a

Timestamp of repository tatsh-overlay: Tue, 09 Nov 2021 10:53:31 +0000
Head commit of repository tatsh-overlay: 9d3ec057e79e86131a17cbfde06bd8982c9dc2f5

sh bash 5.1_p8
ld GNU ld (Gentoo 2.37_p1 p0) 2.37
distcc 3.4 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          5.1_p8::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.34.0-r3::gentoo
dev-lang/python:          2.7.18_p13::gentoo, 3.9.7_p1::gentoo
dev-lang/rust:            1.53.0::gentoo
dev-util/cmake:           3.20.5::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.44.7::gentoo
sys-apps/sandbox:         2.25::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.71-r1::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.16.4::gentoo
sys-devel/binutils:       2.37_p1::gentoo
sys-devel/gcc:            11.2.0::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33-r7::gentoo
Repositories:

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

bell07
    location: /usr/local/bell07_overlay
    sync-type: git
    sync-uri: https://github.com/bell07/gentoo-bell07_overlay
    masters: gentoo

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

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

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

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

crossdev
    location: /usr/local/crossdev-overlay
    masters: gentoo
    priority: 10

Installed sets: @esteam
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
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/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask-write n"
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 -march=native -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs 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 -march=native -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_DE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en de"
MAKEOPTS="-j6"
PKGDIR="/var/cache/binpkgs"
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"
USE="X a52 aac aacs acl acpi alsa amd64 avahi bdplus bluetooth bluray branding bzip2 cacert cairo cdda cddb cdr cli cover crypt css cups dbus dri dts dvd dvdr elogind emboss encode exif fat ffmpeg flac fortran gamepad gdbm gif gimp git gstreamer gtk gtk3 gui hddtemp heif hfs iconv icu ipv6 java jpeg jpeg2k lcms libglvnd libnotify libtirpc lirc lm-sensors logrotate lua luajit mad mdnsresponder-compat mms mng mp3 mp4 mpeg mtp multilib ncurses nls nptl ntfs oauth ocr ogg openexr opengl openmp opus pam pango pcre pdf png policykit postscript ppds printsupport pulseaudio python qt5 readline rtmp samba scanner sdl seccomp snmp spell split-usr sqlite ssl startup-notification svg threads thunar tiff truetype udev udf udisks unicode upower usb v4l vaapi vdpau vorbis vulkan webp widevine wiimote wmf wxwidgets x264 x265 xattr xcb xfce xinerama xml xpmopenexr xrandr xv xvid xvmc zeroconf zlib" ABI_X86="32 64" ADA_TARGET="gnat_2019" 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 f16c fma3 fma4 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 xop" 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 de ru" LCD_DEVICES="imon" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AArch64" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" QEMU_USER_TARGETS="aarch64 i386" RUBY_TARGETS="ruby26 ruby27" SANE_BACKENDS="hp net" USERLAND="GNU" VIDEO_CARDS="radeon radeonsi amdgpu" 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:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS

# emerge -vp openjdk

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N    ~] dev-java/openjdk-17.0.1_p12:17::gentoo  USE="alsa cups jbootstrap pch -debug -doc -examples (-gentoo-vm) -headless-awt (-javafx) (-selinux) -source -systemtap" 0 KiB

 # cat /proc/cpuinfo 
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 48
model name	: AMD A8-7600 Radeon R7, 10 Compute Cores 4C+6G
stepping	: 1
microcode	: 0x6003104
cpu MHz		: 1396.552
cache size	: 2048 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 2
apicid		: 16
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb bpext ptsc cpb hw_pstate ssbd vmmcall fsgsbase bmi1 xsaveopt arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold overflow_recov
bugs		: fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips	: 6190.34
TLB size	: 1536 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro [13]

++++ 4x cores +++
Comment 1 Alexander Weber 2021-11-09 14:54:22 UTC
Created attachment 749898 [details]
build.log
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-09 18:32:32 UTC
Could you follow https://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide?
Comment 3 Alexander Weber 2021-11-09 22:00:51 UTC
The code line triggers the error is:
/usr/bin/x86_64-pc-linux-gnu-g++ -MMD -MF /var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/hotspot/variant-server/libjvm/objs/archiveBuilder.d.tmp -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/hotspot/variant-server/libjvm/objs/precompiled -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D_GNU_SOURCE -D_REENTRANT -pipe -fno-rtti -fno-exceptions -fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer -fcheck-new -fstack-protector -std=c++14 -DLIBC=gnu -DLINUX -Wall -Wextra -Wformat=2 -Wpointer-arith -Wsign-compare -Wunused-function -Wundef -Wunused-value -Wreturn-type -Wtrampolines -Woverloaded-virtual -Wreorder -fPIC -fmacro-prefix-map=/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/= -DVM_LITTLE_ENDIAN -D_LP64=1 -fno-delete-null-pointer-checks -fno-lifetime-dse -Wno-format-zero-length -Wtype-limits -Wuninitialized -m64 -O2 -march=native -pipe -fcommon -DPRODUCT -DTARGET_ARCH_x86 -DINCLUDE_SUFFIX_OS=_linux -DINCLUDE_SUFFIX_CPU=_x86 -DINCLUDE_SUFFIX_COMPILER=_gcc -DTARGET_COMPILER_gcc -DAMD64 -DHOTSPOT_LIB_ARCH='"amd64"' -DCOMPILER1 -DCOMPILER2 -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/hotspot/variant-server/gensrc/adfiles -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/share -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/os/linux -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/os/posix -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/cpu/x86 -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/os_cpu/linux_x86 -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/hotspot/variant-server/gensrc -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/share/precompiled -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/share/include -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/os/posix/include -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/support/modules_include/java.base -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/support/modules_include/java.base/linux -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/java.base/share/native/libjimage -m64 -O2 -march=native -pipe -fcommon -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/hotspot/variant-server/gensrc/adfiles -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/share -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/os/linux -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/os/posix -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/cpu/x86 -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/os_cpu/linux_x86 -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/hotspot/variant-server/gensrc -Wno-unused-parameter -Wno-unused -Wno-parentheses -Wno-comment -Wno-unknown-pragmas -Wno-address -Wno-delete-non-virtual-dtor -Wno-char-subscripts -Wno-array-bounds -Wno-int-in-bool-context -Wno-ignored-qualifiers -Wno-missing-field-initializers -Wno-implicit-fallthrough -Wno-empty-body -Wno-strict-overflow -Wno-sequence-point -Wno-maybe-uninitialized -Wno-misleading-indentation -Wno-cast-function-type -Wno-shift-negative-value -O3 -c -o /var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/hotspot/variant-server/libjvm/objs/archiveBuilder.o /var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/share/cds/archiveBuilder.cpp


If I remove "-march=native" no change on the issue, the error still appears.


# LC_ALL=C /usr/bin/x86_64-pc-linux-gnu-g++ -v
Using built-in specs.
COLLECT_GCC=/usr/bin/x86_64-pc-linux-gnu-g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-11.2.0/work/gcc-11.2.0/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/11.2.0 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/11.2.0 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --disable-libunwind-exceptions --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 11.2.0 p1' --disable-esp --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libssp --disable-libada --disable-systemtap --disable-valgrind-annotations --disable-vtable-verify --disable-libvtv --without-zstd --enable-lto --without-isl --enable-default-pie --enable-default-ssp
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.0 (Gentoo 11.2.0 p1) 


-save-temps generated file ./work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/hotspot/variant-server/libjvm/objs/archiveBuilder.ii I upload to attachments.


# arch=sandybridge; for t in param target; do cmd="gcc -Q -O2 -march=$arch --help=$t"; diff -U0 <(LANG=C $cmd) <(LANG=C $cmd -march=native); done
--- /dev/fd/63	2021-11-09 22:59:46.731683158 +0100
+++ /dev/fd/62	2021-11-09 22:59:46.731683158 +0100
@@ -85,2 +85,2 @@
-  --param=l1-cache-size=      		64
-  --param=l2-cache-size=      		512
+  --param=l1-cache-size=      		16
+  --param=l2-cache-size=      		2048
@@ -223 +223 @@
-  --param=simultaneous-prefetches= 	6
+  --param=simultaneous-prefetches= 	100
--- /dev/fd/63	2021-11-09 22:59:46.751683158 +0100
+++ /dev/fd/62	2021-11-09 22:59:46.751683158 +0100
@@ -12 +12 @@
-  -mabm                       		[disabled]
+  -mabm                       		[enabled]
@@ -16 +16 @@
-  -maes                       		[disabled]
+  -maes                       		[enabled]
@@ -27 +27 @@
-  -march=                     		sandybridge
+  -march=                     		bdver3
@@ -31 +31 @@
-  -mavx256-split-unaligned-load 	[enabled]
+  -mavx256-split-unaligned-load 	[disabled]
@@ -52 +52 @@
-  -mbmi                       		[disabled]
+  -mbmi                       		[enabled]
@@ -54 +54 @@
-  -mbranch-cost=<0,5>         		3
+  -mbranch-cost=<0,5>         		2
@@ -69 +69 @@
-  -mf16c                      		[disabled]
+  -mf16c                      		[enabled]
@@ -74,2 +74,2 @@
-  -mfma                       		[disabled]
-  -mfma4                      		[disabled]
+  -mfma                       		[enabled]
+  -mfma4                      		[enabled]
@@ -80 +80 @@
-  -mfsgsbase                  		[disabled]
+  -mfsgsbase                  		[enabled]
@@ -104,2 +104,2 @@
-  -mlwp                       		[disabled]
-  -mlzcnt                     		[disabled]
+  -mlwp                       		[enabled]
+  -mlzcnt                     		[enabled]
@@ -136 +136 @@
-  -mprefer-vector-width=      		none
+  -mprefer-vector-width=      		128
@@ -139 +139 @@
-  -mprfchw                    		[disabled]
+  -mprfchw                    		[enabled]
@@ -167 +167 @@
-  -msse4a                     		[disabled]
+  -msse4a                     		[enabled]
@@ -179 +179 @@
-  -mtbm                       		[disabled]
+  -mtbm                       		[enabled]
@@ -184 +184 @@
-  -mtune=                     		sandybridge
+  -mtune=                     		bdver3
@@ -196 +196 @@
-  -mxop                       		[disabled]
+  -mxop                       		[enabled]
Comment 4 Alexander Weber 2021-11-09 22:02:52 UTC
Created attachment 749964 [details]
work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/hotspot/variant-server/libjvm/objs/archiveBuilder.ii
Comment 5 Alexander Weber 2021-11-09 22:13:47 UTC
Now I see the "-march=native" is 2x in the command line. If I remove both, the compiling goes fine

Tried the differences from sandybridge comparsion, the -march=bdver3 triggers the error.

-mtune=bdver3 is ok.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-29 22:43:58 UTC
I'm sorry, I'd missed this bug. Reassigning to toolchain@.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-29 22:45:48 UTC
Could you try 11.2.1_p20211127?
Comment 8 Alexander Weber 2021-11-30 11:19:52 UTC
Tried gcc-11.2.1_p20211127. The issue still appears identically
Comment 9 Alexander Weber 2021-12-06 21:15:52 UTC
Just for reference: Tried gcc-8.5.0. The issue appears with old gcc too.
Comment 10 Jakub Paluszak 2021-12-16 06:41:36 UTC
I hit exactly the same bug on AMD Phenom II. My /proc/cpuinfo below:

processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 16
model           : 4
model name      : AMD Phenom(tm) II X4 955 Processor
stepping        : 2
microcode       : 0x10000db
cpu MHz         : 800.000
cache size      : 512 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 4
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate vmmcall npt lbrv svm_lock nrip_save
bugs            : tlb_mmatch fxsave_leak sysret_ss_attrs null_seg amd_e400 spectre_v1 spectre_v2
bogomips        : 6432.61
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

(...)
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-16 06:44:12 UTC
I'd meant to comment this before but apparently didn't: this seems a bit tricky to reproduce for me becaus I don't have such a CPU and Java uses itself to build too. Ideally I'd setup a VM to repliace the environment properly. Help welcome from others though.
Comment 12 Frank Noack 2021-12-17 17:33:17 UTC
The same problem here with a AMD FX 8350. I attach a build.log and an emerge.info too.
Comment 13 Frank Noack 2021-12-17 17:34:21 UTC
Created attachment 759489 [details]
emerge --info file
Comment 14 Frank Noack 2021-12-17 17:45:55 UTC
Created attachment 759490 [details]
build.log part 1
Comment 15 Frank Noack 2021-12-17 17:46:44 UTC
Created attachment 759491 [details]
build.log part2
Comment 16 Alexander Weber 2021-12-18 10:49:08 UTC
I zipped my /var/tmp/portage/dev-java/openjdk-17.0.1_p12 after the issue.
Used gcc is 11.2.1_p20211127

Maybe it help you to reproduce the issue.
I am able to trigger it using the command line:

/usr/bin/x86_64-pc-linux-gnu-g++ -MMD -MF /var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/hotspot/variant-server/libjvm/objs/archiveBuilder.d.tmp -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/hotspot/variant-server/libjvm/objs/precompiled -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D_GNU_SOURCE -D_REENTRANT -pipe -fno-rtti -fno-exceptions -fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer -fcheck-new -fstack-protector -std=c++14 -DLIBC=gnu -DLINUX -Wall -Wextra -Wformat=2 -Wpointer-arith -Wsign-compare -Wunused-function -Wundef -Wunused-value -Wreturn-type -Wtrampolines -Woverloaded-virtual -Wreorder -fPIC -fmacro-prefix-map=/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/= -DVM_LITTLE_ENDIAN -D_LP64=1 -fno-delete-null-pointer-checks -fno-lifetime-dse -Wno-format-zero-length -Wtype-limits -Wuninitialized -m64 -O2 -march=native -pipe -fcommon -DPRODUCT -DTARGET_ARCH_x86 -DINCLUDE_SUFFIX_OS=_linux -DINCLUDE_SUFFIX_CPU=_x86 -DINCLUDE_SUFFIX_COMPILER=_gcc -DTARGET_COMPILER_gcc -DAMD64 -DHOTSPOT_LIB_ARCH='"amd64"' -DCOMPILER1 -DCOMPILER2 -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/hotspot/variant-server/gensrc/adfiles -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/share -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/os/linux -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/os/posix -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/cpu/x86 -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/os_cpu/linux_x86 -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/hotspot/variant-server/gensrc -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/share/precompiled -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/share/include -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/os/posix/include -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/support/modules_include/java.base -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/support/modules_include/java.base/linux -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/java.base/share/native/libjimage -m64 -O2 -march=native -pipe -fcommon -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/hotspot/variant-server/gensrc/adfiles -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/share -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/os/linux -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/os/posix -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/cpu/x86 -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/os_cpu/linux_x86 -I/var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/hotspot/variant-server/gensrc -Wno-unused-parameter -Wno-unused -Wno-parentheses -Wno-comment -Wno-unknown-pragmas -Wno-address -Wno-delete-non-virtual-dtor -Wno-char-subscripts -Wno-array-bounds -Wno-int-in-bool-context -Wno-ignored-qualifiers -Wno-missing-field-initializers -Wno-implicit-fallthrough -Wno-empty-body -Wno-strict-overflow -Wno-sequence-point -Wno-maybe-uninitialized -Wno-misleading-indentation -Wno-cast-function-type -Wno-shift-negative-value -O3 -c -o /var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/build/linux-x86_64-server-release/hotspot/variant-server/libjvm/objs/archiveBuilder.o /var/tmp/portage/dev-java/openjdk-17.0.1_p12/work/jdk17u-jdk-17.0.1-12/src/hotspot/share/cds/archiveBuilder.cpp
Comment 18 Alexander Bezrukov 2021-12-20 08:00:03 UTC
Writing here to confirm that the problem exists on AMD Opteron 290 and that the compilation completes if I remove "-march=native" and "-mtune=native" (or -march=opteron, for this purpose) flags or on Intel systems.
Comment 19 Arsen Arsenović gentoo-dev 2022-01-04 12:15:23 UTC
This is reproducible on a znver1 system with -march=optane in flags too.
Comment 20 Arsen Arsenović gentoo-dev 2022-01-04 13:47:23 UTC
Try building without PCH, please
Comment 21 Sergei Trofimovich 2022-01-04 22:31:27 UTC
Filed https://gcc.gnu.org/PR103910 upstream.
Comment 22 Alexander Weber 2022-01-05 08:13:51 UTC
The issue still happens if I try with "-O2 -march=native -fno-pch-preprocess -pipe"
Is it the right way for "building without PCH"?
Comment 23 Georgy Yakovlev archtester gentoo-dev 2022-01-05 08:48:53 UTC
USE=-pch emerge openjdk:17
^ it's a useflag
Comment 24 Alexander Weber 2022-01-05 10:41:26 UTC
Ah, ok. Using USE="-pch" and -march=native the compiling does work without issue.
Comment 25 Alexander Weber 2022-01-05 13:33:13 UTC
I placed the patch from upstream gcc bug 103910 into /etc/portage/patches/sys-devel/gcc and recompiled sys-devel/gcc-11.2.0

Now the openjdk-17 build fine with -march=native

Please add the patch into portage
Comment 26 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-05 13:42:08 UTC
(In reply to Alexander Weber from comment #25)
> I placed the patch from upstream gcc bug 103910 into
> /etc/portage/patches/sys-devel/gcc and recompiled sys-devel/gcc-11.2.0
> 
> Now the openjdk-17 build fine with -march=native
> 
> Please add the patch into portage

That's obviously planned :)
Comment 27 Larry the Git Cow gentoo-dev 2022-01-08 00:35:34 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8a2f3ab3cc9ff41d049b8fa7374299765a16148

commit d8a2f3ab3cc9ff41d049b8fa7374299765a16148
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2022-01-08 00:33:48 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2022-01-08 00:34:16 +0000

    dev-java/openjdk: disable pch by default
    
    Bug: https://bugs.gentoo.org/822690
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 dev-java/openjdk/openjdk-11.0.13_p8.ebuild | 4 ++--
 dev-java/openjdk/openjdk-17.0.1_p12.ebuild | 4 ++--
 dev-java/openjdk/openjdk-8.312_p07.ebuild  | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
Comment 28 Larry the Git Cow gentoo-dev 2022-01-08 03:49:21 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=7e2dec9de3d94ad18c2136f9ef8dbd48c1a5bdf4

commit 7e2dec9de3d94ad18c2136f9ef8dbd48c1a5bdf4
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-01-08 03:06:25 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-01-08 03:06:50 +0000

    11.3.0: add PR103910 backport (OpenJDK ICE with PCH)
    
    Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103910
    Bug: https://bugs.gentoo.org/822690
    Signed-off-by: Sam James <sam@gentoo.org>

 .../gentoo/76_all_all_PR103910_12_ICE-on-PCH.patch | 35 ++++++++++++++++++++++
 11.3.0/gentoo/README.history                       |  3 ++
 2 files changed, 38 insertions(+)
Comment 29 Larry the Git Cow gentoo-dev 2022-01-08 04:09:11 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=3c8a43b56a2b4fdc040055dadb76665ad4fe0a9c

commit 3c8a43b56a2b4fdc040055dadb76665ad4fe0a9c
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-01-08 04:08:34 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-01-08 04:08:34 +0000

    11.3.0: cut patchset 4
    
    Just includes the PCH fix.
    
    Bug: https://bugs.gentoo.org/822690
    Signed-off-by: Sam James <sam@gentoo.org>

 11.3.0/gentoo/README.history | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Comment 30 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-08 04:10:47 UTC
We'll add a version to tree with this fix shortly.
Comment 31 Larry the Git Cow gentoo-dev 2022-01-12 02:45:31 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb809aeadee57ffa24591e60cfb41aecd4823090

commit fb809aeadee57ffa24591e60cfb41aecd4823090
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-01-12 01:16:55 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-01-12 02:45:18 +0000

    profiles/base: [QA] mask USE=pch
    
    PCH is notoriously fragile & unstable. It often leads
    to (unclear) build failures and has questionable
    value in terms of performance, at least for the general
    case.
    
    Users are free to unmask it if they wish at their
    own risk.
    
    Bug: https://bugs.gentoo.org/753323
    Bug: https://bugs.gentoo.org/822690
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/base/use.mask | 8 ++++++++
 1 file changed, 8 insertions(+)
Comment 32 Larry the Git Cow gentoo-dev 2022-01-18 13:19:56 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b96fd11e3e5626181c32c38381f814aba21fb9f0

commit b96fd11e3e5626181c32c38381f814aba21fb9f0
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-01-18 13:16:42 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-01-18 13:19:30 +0000

    sys-devel/gcc: add 11.2.1_p20220115
    
    Fairly minor changes upstream since the last snapshot of the 11
    stable branch. Includes more CET fixes and the upstream cross-compile
    patch.
    
    Also, the PCH ICE fix, although we've since masked PCH globally
    due to its instability.
    
    Bug: https://bugs.gentoo.org/822036
    Closes: https://bugs.gentoo.org/803371
    Closes: https://bugs.gentoo.org/828400
    Closes: https://bugs.gentoo.org/822690
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/base/package.use.mask            |  2 +-
 sys-devel/gcc/Manifest                    |  3 +++
 sys-devel/gcc/gcc-11.2.1_p20220115.ebuild | 26 ++++++++++++++++++++++++++
 3 files changed, 30 insertions(+), 1 deletion(-)