Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 724314 - sys-devel/gcc-10.1.0-r1 stack corruption in cp_gimplify_expr() when building dev-libs/boost-1.73.0
Summary: sys-devel/gcc-10.1.0-r1 stack corruption in cp_gimplify_expr() when building ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal major (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://wiki.gentoo.org/wiki/Project:...
Whiteboard:
Keywords:
: 729308 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-05-20 09:56 UTC by myloveyuxuan
Modified: 2020-09-07 13:46 UTC (History)
6 users (show)

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


Attachments
Build Log (dev-libs-boost-1.73.0-20200520-163917.log,352.90 KB, application/octet-stream)
2020-05-20 09:58 UTC, myloveyuxuan
Details
preprocessed file of xml_grammar.c (xml_grammar.zip,334.91 KB, application/x-zip-compressed)
2020-06-08 14:05 UTC, myloveyuxuan
Details
The preprocessed file of xml_grammar.cpp (xml_grammar.E.zip,334.78 KB, application/x-zip-compressed)
2020-06-09 12:57 UTC, myloveyuxuan
Details
The output of `emerge --info sys-devel/gcc sys-libs/glibc` (emerge--info-output.txt,7.10 KB, text/plain)
2020-06-11 10:58 UTC, myloveyuxuan
Details
The error messages when I try to compile xml_grammar.cpp for five times (compile.zip,3.25 KB, application/x-zip-compressed)
2020-06-11 11:04 UTC, myloveyuxuan
Details
Debug log (gdb.txt,58.39 KB, text/plain)
2020-06-22 03:32 UTC, myloveyuxuan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description myloveyuxuan 2020-05-20 09:56:58 UTC
Portage seems failed to build `dev-libs/boost-1.73.0` when I type `emerge --ask kde-plasma/plasma-meta`.

Reproducible: Always

Steps to Reproduce:
1.Build a new Gentoo System
2.Try to type emerge `emerge kde-plasma/plasma-meta`
Actual Results:  
Build failed
Comment 1 myloveyuxuan 2020-05-20 09:58:43 UTC
Created attachment 640550 [details]
Build Log

Build log generated when it built failed
Comment 2 myloveyuxuan 2020-05-20 09:59:20 UTC
Portage 2.3.99 (python 3.7.7-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-10.1.0, glibc-2.31-r3, 5.6.13-gentoo x86_64)
=================================================================
System uname: Linux-5.6.13-gentoo-x86_64-AMD_Ryzen_5_1600_Six-Core_Processor-with-gentoo-2.7
KiB Mem:     8164568 total,   3929688 free
KiB Swap:    8388604 total,   8388604 free
Timestamp of repository gentoo: Wed, 20 May 2020 02:15:01 +0000
Head commit of repository gentoo: cf95a138451d35566712e45ae763c0470ea2254e
sh bash 5.0_p17
ld GNU ld (Gentoo 2.34 p4) 2.34.0
app-shells/bash:          5.0_p17::gentoo
dev-lang/perl:            5.30.2-r2::gentoo
dev-lang/python:          2.7.18::gentoo, 3.7.7-r2::gentoo, 3.8.3::gentoo
dev-util/cmake:           3.17.2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.2::gentoo
sys-devel/binutils:       2.34-r1::gentoo
sys-devel/gcc:            10.1.0::gentoo
sys-devel/gcc-config:     2.2.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.6::gentoo (virtual/os-headers)
sys-libs/glibc:           2.31-r3::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://mirrors.tuna.tsinghua.edu.cn/gentoo-portage
    priority: -1000
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -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/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O3 -pipe -march=native"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--ask"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN 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="-O3 -pipe -march=native"
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="-O3 -pipe -march=native"
GENTOO_MIRRORS="https://mirrors.tuna.tsinghua.edu.cn/gentoo"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
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 acl acpi activities alsa amd64 berkdb branding bzip2 cairo cdda cdr cli crypt cups dbus declarative dri dts dvd dvdr elogind emboss encode exif flac fortran gdbm gif gpm gtk iconv icu ipv6 jpeg kde kipi kwallet lcms ldap libnotify libtirpc mad mng mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds qml qt5 readline sdl seccomp semantic-desktop spell split-usr ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis widgets wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="mmx mmxext sse sse2" 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" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 David Seifert gentoo-dev 2020-06-02 08:59:01 UTC
Paging in slyfox, who might be able to help, given that this is an ICE.
Comment 4 Sergei Trofimovich gentoo-dev 2020-06-02 17:11:29 UTC
"""
    "x86_64-pc-linux-gnu-g++"   -fvisibility-inlines-hidden -O3 -pipe -march=native -std=c++14 -fPIC -m64 -pthread -finline-functions -Wno-inline -
Wall -fvisibility=hidden -ftemplate-depth-255 -fvisibility=hidden -fvisibility-inlines-hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_SERIALIZATION_DYN_LINK=1
 -DNDEBUG  -I"." -c -o "bin.v2/libs/serialization/build/gcc-10.1/gentoorelease/pch-off/threading-multi/visibility-hidden/xml_grammar.o" "libs/seria
lization/src/xml_grammar.cpp"

*** stack smashing detected ***: terminated
In file included from libs/serialization/src/xml_grammar.cpp:64:
libs/serialization/src/basic_xml_grammar.ipp: In constructor ‘boost::archive::basic_xml_grammar<CharType>::basic_xml_grammar() [with CharType = cha
r]’:
libs/serialization/src/basic_xml_grammar.ipp:406:9: internal compiler error: Aborted
  402 |         !S
      |         ~~
  403 |         >> str_p(L"<?xml")
      |         ~~~~~~~~~~~~~~~~~~
  404 |         >> S
      |         ~~~~
  405 |         >> str_p(L"version")
      |         ~~~~~~~~~~~~~~~~~~~~
  406 |         >> Eq
      |         ^~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.
"""

Yeah, looks like a toolchain bug. I'll try to reproduce locally. 

Meanwhile, myloveyuxuan@gmail.com, can you follow https://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide to extract preprocessed file and expand -march=native?
Comment 5 Sergei Trofimovich gentoo-dev 2020-06-03 09:04:55 UTC
(In reply to Sergei Trofimovich from comment #4)
> I'll try to reproduce locally. 


I was not able to reproduce locally in an -O3 -march=native chroot. That probably means that gcc itself was mis-compiled for your target. Try to get a symbolized gcc backtrace when if smashes it's sack. https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces should help in that.
Comment 6 myloveyuxuan 2020-06-08 13:51:05 UTC
The following options are target specific:
  -m128bit-long-double        		[disabled]
  -m16                        		[disabled]
  -m32                        		[disabled]
  -m3dnow                     		[disabled]
  -m3dnowa                    		[disabled]
  -m64                        		[enabled]
  -m80387                     		[enabled]
  -m8bit-idiv                 		[disabled]
  -m96bit-long-double         		[enabled]
  -mabi=                      		sysv
  -mabm                       		[disabled]
  -maccumulate-outgoing-args  		[disabled]
  -maddress-mode=             		short
  -madx                       		[disabled]
  -maes                       		[disabled]
  -malign-data=               		compat
  -malign-double              		[disabled]
  -malign-functions=          		0
  -malign-jumps=              		0
  -malign-loops=              		0
  -malign-stringops           		[enabled]
  -mandroid                   		[disabled]
  -march=                     		x86-64
  -masm=                      		att
  -mavx                       		[disabled]
  -mavx2                      		[disabled]
  -mavx256-split-unaligned-load 	[disabled]
  -mavx256-split-unaligned-store 	[disabled]
  -mavx5124fmaps              		[disabled]
  -mavx5124vnniw              		[disabled]
  -mavx512bf16                		[disabled]
  -mavx512bitalg              		[disabled]
  -mavx512bw                  		[disabled]
  -mavx512cd                  		[disabled]
  -mavx512dq                  		[disabled]
  -mavx512er                  		[disabled]
  -mavx512f                   		[disabled]
  -mavx512ifma                		[disabled]
  -mavx512pf                  		[disabled]
  -mavx512vbmi                		[disabled]
  -mavx512vbmi2               		[disabled]
  -mavx512vl                  		[disabled]
  -mavx512vnni                		[disabled]
  -mavx512vp2intersect        		[disabled]
  -mavx512vpopcntdq           		[disabled]
  -mbionic                    		[disabled]
  -mbmi                       		[disabled]
  -mbmi2                      		[disabled]
  -mbranch-cost=<0,5>         		0
  -mcall-ms2sysv-xlogues      		[disabled]
  -mcet-switch                		[disabled]
  -mcld                       		[disabled]
  -mcldemote                  		[disabled]
  -mclflushopt                		[disabled]
  -mclwb                      		[disabled]
  -mclzero                    		[disabled]
  -mcmodel=                   		32
  -mcpu=                      		
  -mcrc32                     		[disabled]
  -mcx16                      		[disabled]
  -mdispatch-scheduler        		[disabled]
  -mdump-tune-features        		[disabled]
  -menqcmd                    		[disabled]
  -mf16c                      		[disabled]
  -mfancy-math-387            		[enabled]
  -mfentry                    		[disabled]
  -mfentry-name=              		
  -mfentry-section=           		
  -mfma                       		[disabled]
  -mfma4                      		[disabled]
  -mforce-drap                		[disabled]
  -mforce-indirect-call       		[disabled]
  -mfp-ret-in-387             		[enabled]
  -mfpmath=                   		387
  -mfsgsbase                  		[disabled]
  -mfunction-return=          		keep
  -mfused-madd                		-ffp-contract=fast
  -mfxsr                      		[disabled]
  -mgeneral-regs-only         		[disabled]
  -mgfni                      		[disabled]
  -mglibc                     		[enabled]
  -mhard-float                		[enabled]
  -mhle                       		[disabled]
  -miamcu                     		[disabled]
  -mieee-fp                   		[enabled]
  -mincoming-stack-boundary=  		0
  -mindirect-branch-register  		[disabled]
  -mindirect-branch=          		keep
  -minline-all-stringops      		[disabled]
  -minline-stringops-dynamically 	[disabled]
  -minstrument-return=        		none
  -mintel-syntax              		-masm=intel
  -mlarge-data-threshold=<number> 	65536
  -mlong-double-128           		[disabled]
  -mlong-double-64            		[disabled]
  -mlong-double-80            		[enabled]
  -mlwp                       		[disabled]
  -mlzcnt                     		[disabled]
  -mmanual-endbr              		[disabled]
  -mmemcpy-strategy=          		
  -mmemset-strategy=          		
  -mmitigate-rop              		[disabled]
  -mmmx                       		[disabled]
  -mmovbe                     		[disabled]
  -mmovdir64b                 		[disabled]
  -mmovdiri                   		[disabled]
  -mmpx                       		[disabled]
  -mms-bitfields              		[disabled]
  -mmusl                      		[disabled]
  -mmwaitx                    		[disabled]
  -mno-align-stringops        		[disabled]
  -mno-default                		[disabled]
  -mno-fancy-math-387         		[disabled]
  -mno-push-args              		[disabled]
  -mno-red-zone               		[disabled]
  -mno-sse4                   		[enabled]
  -mnop-mcount                		[disabled]
  -momit-leaf-frame-pointer   		[disabled]
  -mpc32                      		[disabled]
  -mpc64                      		[disabled]
  -mpc80                      		[disabled]
  -mpclmul                    		[disabled]
  -mpcommit                   		[disabled]
  -mpconfig                   		[disabled]
  -mpku                       		[disabled]
  -mpopcnt                    		[disabled]
  -mprefer-avx128             		-mprefer-vector-width=128
  -mprefer-vector-width=      		none
  -mpreferred-stack-boundary= 		0
  -mprefetchwt1               		[disabled]
  -mprfchw                    		[disabled]
  -mptwrite                   		[disabled]
  -mpush-args                 		[enabled]
  -mrdpid                     		[disabled]
  -mrdrnd                     		[disabled]
  -mrdseed                    		[disabled]
  -mrecip                     		[disabled]
  -mrecip=                    		
  -mrecord-mcount             		[disabled]
  -mrecord-return             		[disabled]
  -mred-zone                  		[enabled]
  -mregparm=                  		0
  -mrtd                       		[disabled]
  -mrtm                       		[disabled]
  -msahf                      		[disabled]
  -msgx                       		[disabled]
  -msha                       		[disabled]
  -mshstk                     		[disabled]
  -mskip-rax-setup            		[disabled]
  -msoft-float                		[disabled]
  -msse                       		[disabled]
  -msse2                      		[disabled]
  -msse2avx                   		[disabled]
  -msse3                      		[disabled]
  -msse4                      		[disabled]
  -msse4.1                    		[disabled]
  -msse4.2                    		[disabled]
  -msse4a                     		[disabled]
  -msse5                      		-mavx
  -msseregparm                		[disabled]
  -mssse3                     		[disabled]
  -mstack-arg-probe           		[disabled]
  -mstack-protector-guard-offset= 	
  -mstack-protector-guard-reg= 		
  -mstack-protector-guard-symbol= 	
  -mstack-protector-guard=    		tls
  -mstackrealign              		[disabled]
  -mstringop-strategy=        		[default]
  -mstv                       		[disabled]
  -mtbm                       		[disabled]
  -mtls-dialect=              		gnu
  -mtls-direct-seg-refs       		[enabled]
  -mtune-ctrl=                		
  -mtune=                     		generic
  -muclibc                    		[disabled]
  -mvaes                      		[disabled]
  -mveclibabi=                		[default]
  -mvect8-ret-in-mem          		[disabled]
  -mvpclmulqdq                		[disabled]
  -mvzeroupper                		[disabled]
  -mwaitpkg                   		[disabled]
  -mwbnoinvd                  		[disabled]
  -mx32                       		[disabled]
  -mxop                       		[disabled]
  -mxsave                     		[disabled]
  -mxsavec                    		[disabled]
  -mxsaveopt                  		[disabled]
  -mxsaves                    		[disabled]

  Known assembler dialects (for use with the -masm= option):
    att intel

  Known ABIs (for use with the -mabi= option):
    ms sysv

  Known code models (for use with the -mcmodel= option):
    32 kernel large medium small

  Valid arguments to -mfpmath=:
    387 387+sse 387,sse both sse sse+387 sse,387

  Known indirect branch choices (for use with the -mindirect-branch=/-mfunction-return= options):
    keep thunk thunk-extern thunk-inline

  Known choices for return instrumentation with -minstrument-return=:
    call none nop5

  Known data alignment choices (for use with the -malign-data= option):
    abi cacheline compat

  Known vectorization library ABIs (for use with the -mveclibabi= option):
    acml svml

  Known address mode (for use with the -maddress-mode= option):
    long short

  Known preferred register vector length (to use with the -mprefer-vector-width= option):
    128 256 512 none

  Known stack protector guard (for use with the -mstack-protector-guard= option):
    global tls

  Valid arguments to -mstringop-strategy=:
    byte_loop libcall loop rep_4byte rep_8byte rep_byte unrolled_loop vector_loop

  Known TLS dialects (for use with the -mtls-dialect= option):
    gnu gnu2

  Known valid arguments for -march= option:
    i386 i486 i586 pentium lakemont pentium-mmx winchip-c6 winchip2 c3 samuel-2 c3-2 nehemiah c7 esther i686 pentiumpro pentium2 pentium3 pentium3m pentium-m pentium4 pentium4m prescott nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client icelake-server cascadelake tigerlake cooperlake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm intel geode k6 k6-2 k6-3 athlon athlon-tbird athlon-4 athlon-xp athlon-mp x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 btver1 btver2 generic native

  Known valid arguments for -mtune= option:
    generic i386 i486 pentium lakemont pentiumpro pentium4 nocona core2 nehalem sandybridge haswell bonnell silvermont goldmont goldmont-plus tremont knl knm skylake skylake-avx512 cannonlake icelake-client icelake-server cascadelake tigerlake cooperlake intel geode k6 athlon k8 amdfam10 bdver1 bdver2 bdver3 bdver4 btver1 btver2 znver1 znver2
Comment 7 myloveyuxuan 2020-06-08 13:51:39 UTC
--- default.opts	2020-06-09 05:24:52.653429794 +0800
+++ native.opts	2020-06-09 05:24:58.589430204 +0800
@@ -12 +12 @@
-  -mabm                       		[disabled]
+  -mabm                       		[enabled]
@@ -15,2 +15,2 @@
-  -madx                       		[disabled]
-  -maes                       		[disabled]
+  -madx                       		[enabled]
+  -maes                       		[enabled]
@@ -24 +24 @@
-  -march=                     		x86-64
+  -march=                     		znver1
@@ -26,2 +26,2 @@
-  -mavx                       		[disabled]
-  -mavx2                      		[disabled]
+  -mavx                       		[enabled]
+  -mavx2                      		[enabled]
@@ -48,2 +48,2 @@
-  -mbmi                       		[disabled]
-  -mbmi2                      		[disabled]
+  -mbmi                       		[enabled]
+  -mbmi2                      		[enabled]
@@ -55 +55 @@
-  -mclflushopt                		[disabled]
+  -mclflushopt                		[enabled]
@@ -57 +57 @@
-  -mclzero                    		[disabled]
+  -mclzero                    		[enabled]
@@ -61 +61 @@
-  -mcx16                      		[disabled]
+  -mcx16                      		[enabled]
@@ -65 +65 @@
-  -mf16c                      		[disabled]
+  -mf16c                      		[enabled]
@@ -70 +70 @@
-  -mfma                       		[disabled]
+  -mfma                       		[enabled]
@@ -76 +76 @@
-  -mfsgsbase                  		[disabled]
+  -mfsgsbase                  		[enabled]
@@ -79 +79 @@
-  -mfxsr                      		[disabled]
+  -mfxsr                      		[enabled]
@@ -99 +99 @@
-  -mlzcnt                     		[disabled]
+  -mlzcnt                     		[enabled]
@@ -104,2 +104,2 @@
-  -mmmx                       		[disabled]
-  -mmovbe                     		[disabled]
+  -mmmx                       		[enabled]
+  -mmovbe                     		[enabled]
@@ -111 +111 @@
-  -mmwaitx                    		[disabled]
+  -mmwaitx                    		[enabled]
@@ -117 +117 @@
-  -mno-sse4                   		[enabled]
+  -mno-sse4                   		[disabled]
@@ -123 +123 @@
-  -mpclmul                    		[disabled]
+  -mpclmul                    		[enabled]
@@ -127 +127 @@
-  -mpopcnt                    		[disabled]
+  -mpopcnt                    		[enabled]
@@ -132 +132 @@
-  -mprfchw                    		[disabled]
+  -mprfchw                    		[enabled]
@@ -136,2 +136,2 @@
-  -mrdrnd                     		[disabled]
-  -mrdseed                    		[disabled]
+  -mrdrnd                     		[enabled]
+  -mrdseed                    		[enabled]
@@ -146 +146 @@
-  -msahf                      		[disabled]
+  -msahf                      		[enabled]
@@ -148 +148 @@
-  -msha                       		[disabled]
+  -msha                       		[enabled]
@@ -152,2 +152,2 @@
-  -msse                       		[disabled]
-  -msse2                      		[disabled]
+  -msse                       		[enabled]
+  -msse2                      		[enabled]
@@ -155,5 +155,5 @@
-  -msse3                      		[disabled]
-  -msse4                      		[disabled]
-  -msse4.1                    		[disabled]
-  -msse4.2                    		[disabled]
-  -msse4a                     		[disabled]
+  -msse3                      		[enabled]
+  -msse4                      		[enabled]
+  -msse4.1                    		[enabled]
+  -msse4.2                    		[enabled]
+  -msse4a                     		[enabled]
@@ -162 +162 @@
-  -mssse3                     		[disabled]
+  -mssse3                     		[enabled]
@@ -175 +175 @@
-  -mtune=                     		generic
+  -mtune=                     		znver1
@@ -186,4 +186,4 @@
-  -mxsave                     		[disabled]
-  -mxsavec                    		[disabled]
-  -mxsaveopt                  		[disabled]
-  -mxsaves                    		[disabled]
+  -mxsave                     		[enabled]
+  -mxsavec                    		[enabled]
+  -mxsaveopt                  		[enabled]
+  -mxsaves                    		[enabled]
Comment 8 myloveyuxuan 2020-06-08 13:58:21 UTC
The following options control optimizations:
  -O<number>                  		
  -Ofast                      		
  -Og                         		
  -Os                         		
  -faggressive-loop-optimizations 	[enabled]
  -falign-functions           		[enabled]
  -falign-functions=          		
  -falign-jumps               		[enabled]
  -falign-jumps=              		
  -falign-labels              		[enabled]
  -falign-labels=             		
  -falign-loops               		[enabled]
  -falign-loops=              		
  -fallocation-dce            		[enabled]
  -fallow-store-data-races    		[disabled]
  -fassociative-math          		[disabled]
  -fassume-phsa               		[available in BRIG]
  -fasynchronous-unwind-tables 		[enabled]
  -fauto-inc-dec              		[enabled]
  -fbranch-count-reg          		[enabled]
  -fbranch-probabilities      		[disabled]
  -fcaller-saves              		[enabled]
  -fcode-hoisting             		[enabled]
  -fcombine-stack-adjustments 		[enabled]
  -fcompare-elim              		[enabled]
  -fconserve-stack            		[disabled]
  -fcprop-registers           		[enabled]
  -fcrossjumping              		[enabled]
  -fcse-follow-jumps          		[enabled]
  -fcx-fortran-rules          		[disabled]
  -fcx-limited-range          		[disabled]
  -fdce                       		[enabled]
  -fdefer-pop                 		[enabled]
  -fdelayed-branch            		[disabled]
  -fdelete-dead-exceptions    		[disabled]
  -fdelete-null-pointer-checks 		[enabled]
  -fdevirtualize              		[enabled]
  -fdevirtualize-speculatively 		[enabled]
  -fdse                       		[enabled]
  -fearly-inlining            		[enabled]
  -fexceptions                		[disabled]
  -fexcess-precision=[fast|standard] 	[default]
  -fexpensive-optimizations   		[enabled]
  -ffast-math                 		
  -ffinite-loops              		[disabled]
  -ffinite-math-only          		[disabled]
  -ffloat-store               		[disabled]
  -fforward-propagate         		[enabled]
  -ffp-contract=[off|on|fast] 		fast
  -ffp-int-builtin-inexact    		[enabled]
  -ffunction-cse              		[enabled]
  -fgcse                      		[enabled]
  -fgcse-after-reload         		[enabled]
  -fgcse-las                  		[disabled]
  -fgcse-lm                   		[enabled]
  -fgcse-sm                   		[disabled]
  -fgraphite                  		[disabled]
  -fgraphite-identity         		[disabled]
  -fguess-branch-probability  		[enabled]
  -fhandle-exceptions         		-fexceptions
  -fhoist-adjacent-loads      		[enabled]
  -fif-conversion             		[enabled]
  -fif-conversion2            		[enabled]
  -findirect-inlining         		[enabled]
  -finline                    		[enabled]
  -finline-atomics            		[enabled]
  -finline-functions          		[enabled]
  -finline-functions-called-once 	[enabled]
  -finline-small-functions    		[enabled]
  -fipa-bit-cp                		[enabled]
  -fipa-cp                    		[enabled]
  -fipa-cp-clone              		[enabled]
  -fipa-icf                   		[enabled]
  -fipa-icf-functions         		[enabled]
  -fipa-icf-variables         		[enabled]
  -fipa-profile               		[enabled]
  -fipa-pta                   		[disabled]
  -fipa-pure-const            		[enabled]
  -fipa-ra                    		[enabled]
  -fipa-reference             		[enabled]
  -fipa-reference-addressable 		[enabled]
  -fipa-sra                   		[enabled]
  -fipa-stack-alignment       		[enabled]
  -fipa-vrp                   		[enabled]
  -fira-algorithm=[CB|priority] 	CB
  -fira-hoist-pressure        		[enabled]
  -fira-loop-pressure         		[disabled]
  -fira-region=[one|all|mixed] 		[default]
  -fira-share-save-slots      		[enabled]
  -fira-share-spill-slots     		[enabled]
  -fisolate-erroneous-paths-attribute 	[disabled]
  -fisolate-erroneous-paths-dereference 	[enabled]
  -fivopts                    		[enabled]
  -fjump-tables               		[enabled]
  -fkeep-gc-roots-live        		[disabled]
  -flifetime-dse              		[enabled]
  -flifetime-dse=<0,2>        		2
  -flimit-function-alignment  		[disabled]
  -flive-patching             		-flive-patching=inline-clone
  -flive-patching=[inline-only-static|inline-clone] 	[default]
  -flive-range-shrinkage      		[disabled]
  -floop-interchange          		[enabled]
  -floop-nest-optimize        		[disabled]
  -floop-parallelize-all      		[disabled]
  -floop-unroll-and-jam       		[enabled]
  -flra-remat                 		[enabled]
  -fmath-errno                		[enabled]
  -fmodulo-sched              		[disabled]
  -fmodulo-sched-allow-regmoves 	[disabled]
  -fmove-loop-invariants      		[enabled]
  -fnon-call-exceptions       		[disabled]
  -fnothrow-opt               		[available in C++, ObjC++]
  -fomit-frame-pointer        		[enabled]
  -fopt-info                  		[disabled]
  -foptimize-sibling-calls    		[enabled]
  -foptimize-strlen           		[enabled]
  -fpack-struct               		[disabled]
  -fpack-struct=<number>      		
  -fpartial-inlining          		[enabled]
  -fpatchable-function-entry= 		
  -fpeel-loops                		[enabled]
  -fpeephole                  		[enabled]
  -fpeephole2                 		[enabled]
  -fplt                       		[enabled]
  -fpredictive-commoning      		[enabled]
  -fprefetch-loop-arrays      		[enabled]
  -fprintf-return-value       		[enabled]
  -fprofile-partial-training  		[disabled]
  -fprofile-reorder-functions 		[disabled]
  -freciprocal-math           		[disabled]
  -free                       		[enabled]
  -freg-struct-return         		[disabled]
  -frename-registers          		[enabled]
  -freorder-blocks            		[enabled]
  -freorder-blocks-algorithm=[simple|stc] 	stc
  -freorder-blocks-and-partition 	[enabled]
  -freorder-functions         		[enabled]
  -frerun-cse-after-loop      		[enabled]
  -freschedule-modulo-scheduled-loops 	[disabled]
  -frounding-math             		[disabled]
  -frtti                      		[available in C++, D, ObjC++]
  -fsave-optimization-record  		[disabled]
  -fsched-critical-path-heuristic 	[enabled]
  -fsched-dep-count-heuristic 		[enabled]
  -fsched-group-heuristic     		[enabled]
  -fsched-interblock          		[enabled]
  -fsched-last-insn-heuristic 		[enabled]
  -fsched-pressure            		[disabled]
  -fsched-rank-heuristic      		[enabled]
  -fsched-spec                		[enabled]
  -fsched-spec-insn-heuristic 		[enabled]
  -fsched-spec-load           		[disabled]
  -fsched-spec-load-dangerous 		[disabled]
  -fsched-stalled-insns       		[disabled]
  -fsched-stalled-insns-dep   		[enabled]
  -fsched-stalled-insns-dep=<number> 	
  -fsched-stalled-insns=<number> 	
  -fsched2-use-superblocks    		[disabled]
  -fschedule-fusion           		[enabled]
  -fschedule-insns            		[disabled]
  -fschedule-insns2           		[enabled]
  -fsection-anchors           		[disabled]
  -fsel-sched-pipelining      		[disabled]
  -fsel-sched-pipelining-outer-loops 	[disabled]
  -fsel-sched-reschedule-pipelined 	[disabled]
  -fselective-scheduling      		[disabled]
  -fselective-scheduling2     		[disabled]
  -fshort-enums               		[enabled]
  -fshort-wchar               		[disabled]
  -fshrink-wrap               		[enabled]
  -fshrink-wrap-separate      		[enabled]
  -fsignaling-nans            		[disabled]
  -fsigned-zeros              		[enabled]
  -fsimd-cost-model=[unlimited|dynamic|cheap] 	unlimited
  -fsingle-precision-constant 		[disabled]
  -fsplit-ivs-in-unroller     		[enabled]
  -fsplit-loops               		[enabled]
  -fsplit-paths               		[enabled]
  -fsplit-wide-types          		[enabled]
  -fsplit-wide-types-early    		[disabled]
  -fssa-backprop              		[enabled]
  -fssa-phiopt                		[enabled]
  -fstack-check=[no|generic|specific] 	
  -fstack-clash-protection    		[enabled]
  -fstack-protector           		[disabled]
  -fstack-protector-all       		[disabled]
  -fstack-protector-explicit  		[disabled]
  -fstack-protector-strong    		[enabled]
  -fstack-reuse=[all|named_vars|none] 	all
  -fstdarg-opt                		[enabled]
  -fstore-merging             		[enabled]
  -fstrict-aliasing           		[enabled]
  -fstrict-enums              		[available in C++, ObjC++]
  -fstrict-volatile-bitfields 		[enabled]
  -fthread-jumps              		[enabled]
  -fno-threadsafe-statics     		[available in C++, ObjC++]
  -ftoplevel-reorder          		[enabled]
  -ftracer                    		[disabled]
  -ftrapping-math             		[enabled]
  -ftrapv                     		[disabled]
  -ftree-bit-ccp              		[enabled]
  -ftree-builtin-call-dce     		[enabled]
  -ftree-ccp                  		[enabled]
  -ftree-ch                   		[enabled]
  -ftree-coalesce-vars        		[enabled]
  -ftree-copy-prop            		[enabled]
  -ftree-cselim               		[enabled]
  -ftree-dce                  		[enabled]
  -ftree-dominator-opts       		[enabled]
  -ftree-dse                  		[enabled]
  -ftree-forwprop             		[enabled]
  -ftree-fre                  		[enabled]
  -ftree-loop-distribute-patterns 	[enabled]
  -ftree-loop-distribution    		[enabled]
  -ftree-loop-if-convert      		[enabled]
  -ftree-loop-im              		[enabled]
  -ftree-loop-ivcanon         		[enabled]
  -ftree-loop-optimize        		[enabled]
  -ftree-loop-vectorize       		[enabled]
  -ftree-lrs                  		[disabled]
  -ftree-parallelize-loops=<number> 	1
  -ftree-partial-pre          		[enabled]
  -ftree-phiprop              		[enabled]
  -ftree-pre                  		[enabled]
  -ftree-pta                  		[enabled]
  -ftree-reassoc              		[enabled]
  -ftree-scev-cprop           		[enabled]
  -ftree-sink                 		[enabled]
  -ftree-slp-vectorize        		[enabled]
  -ftree-slsr                 		[enabled]
  -ftree-sra                  		[enabled]
  -ftree-switch-conversion    		[enabled]
  -ftree-tail-merge           		[enabled]
  -ftree-ter                  		[enabled]
  -ftree-vectorize            		
  -ftree-vrp                  		[enabled]
  -funconstrained-commons     		[disabled]
  -funroll-all-loops          		[disabled]
  -funroll-loops              		[disabled]
  -funsafe-math-optimizations 		[disabled]
  -funswitch-loops            		[enabled]
  -funwind-tables             		[disabled]
  -fvar-tracking              		[enabled]
  -fvar-tracking-assignments  		[enabled]
  -fvar-tracking-assignments-toggle 	[disabled]
  -fvar-tracking-uninit       		[disabled]
  -fvariable-expansion-in-unroller 	[disabled]
  -fvect-cost-model=[unlimited|dynamic|cheap] 	dynamic
  -fversion-loops-for-strides 		[enabled]
  -fvpt                       		[disabled]
  -fweb                       		[enabled]
  -fwrapv                     		[disabled]
  -fwrapv-pointer             		[disabled]
Comment 9 myloveyuxuan 2020-06-08 13:58:57 UTC
--- O2.opts	2020-06-09 05:26:53.908438157 +0800
+++ O3.opts	2020-06-09 05:27:00.732438628 +0800
@@ -54 +54 @@
-  -fgcse-after-reload         		[disabled]
+  -fgcse-after-reload         		[enabled]
@@ -73 +73 @@
-  -fipa-cp-clone              		[disabled]
+  -fipa-cp-clone              		[enabled]
@@ -103 +103 @@
-  -floop-interchange          		[disabled]
+  -floop-interchange          		[enabled]
@@ -106 +106 @@
-  -floop-unroll-and-jam       		[disabled]
+  -floop-unroll-and-jam       		[enabled]
@@ -122 +122 @@
-  -fpeel-loops                		[disabled]
+  -fpeel-loops                		[enabled]
@@ -126 +126 @@
-  -fpredictive-commoning      		[disabled]
+  -fpredictive-commoning      		[enabled]
@@ -178,2 +178,2 @@
-  -fsplit-loops               		[disabled]
-  -fsplit-paths               		[disabled]
+  -fsplit-loops               		[enabled]
+  -fsplit-paths               		[enabled]
@@ -215 +215 @@
-  -ftree-loop-distribution    		[disabled]
+  -ftree-loop-distribution    		[enabled]
@@ -220 +220 @@
-  -ftree-loop-vectorize       		[disabled]
+  -ftree-loop-vectorize       		[enabled]
@@ -223 +223 @@
-  -ftree-partial-pre          		[disabled]
+  -ftree-partial-pre          		[enabled]
@@ -230 +230 @@
-  -ftree-slp-vectorize        		[disabled]
+  -ftree-slp-vectorize        		[enabled]
@@ -242 +242 @@
-  -funswitch-loops            		[disabled]
+  -funswitch-loops            		[enabled]
@@ -249,2 +249,2 @@
-  -fvect-cost-model=[unlimited|dynamic|cheap] 	cheap
-  -fversion-loops-for-strides 		[disabled]
+  -fvect-cost-model=[unlimited|dynamic|cheap] 	dynamic
+  -fversion-loops-for-strides 		[enabled]
Comment 10 myloveyuxuan 2020-06-08 13:59:11 UTC
Currently logging to "gdb.txt".
Logs will be appended to the log file.
Output will be logged and displayed.
Debug output will be logged and displayed.
Function "internal_error" not defined.
Breakpoint 1 (internal_error) pending.
Starting program: /usr/bin/x86_64-pc-linux-gnu-g++ -fvisibility-inlines-hidden -O3 -march=native -pipe -std=c++14 -fPIC -m64 -pthread -finline-functions -Wno-inline -Wall -fvisibility=hidden -ftemplate-depth-255 -fvisibility=hidden -fvisibility-inlines-hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_SERIALIZATION_DYN_LINK=1 -DNDEBUG -I. -c -o bin.v2/libs/serialization/build/gcc-10.1/gentoorelease/pch-off/threading-multi/visibility-hidden/xml_grammar.o libs/serialization/src/xml_grammar.cpp
[Attaching after process 31746 vfork to child process 31750]
[New inferior 2 (process 31750)]
[Detaching vfork parent process 31746 after child exec]
[Inferior 1 (process 31746) detached]
process 31750 is executing new program: /usr/libexec/gcc/x86_64-pc-linux-gnu/10.1.0/cc1plus

Thread 2.1 "cc1plus" received signal SIGABRT, Aborted.
[Switching to process 31750]
0x00007ffff7bc39a1 in raise () from /lib64/libc.so.6
#0  0x00007ffff7bc39a1 in raise () from /lib64/libc.so.6
#1  0x00007ffff7bad53b in abort () from /lib64/libc.so.6
#2  0x00007ffff7c07ae7 in ?? () from /lib64/libc.so.6
#3  0x00007ffff7c98e12 in __fortify_fail () from /lib64/libc.so.6
#4  0x00007ffff7c98df0 in __stack_chk_fail () from /lib64/libc.so.6
#5  0x000000000065a1f2 in cp_gimplify_expr(tree_node**, gimple**, gimple**) ()
#6  0x00000000009f505c in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#7  0x00000000009fe351 in ?? ()
#8  0x00000000009f63b0 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#9  0x00000000009fb6b1 in ?? ()
#10 0x00000000009f5fcf in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#11 0x00000000009fbad5 in ?? ()
#12 0x00000000009fc456 in ?? ()
#13 0x00000000009f63d3 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#14 0x00000000009faf11 in ?? ()
#15 0x00000000009f6364 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#16 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#17 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#18 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#19 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#20 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#21 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#22 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#23 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#24 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#25 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#26 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#27 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#28 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#29 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#30 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#31 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#32 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#33 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#34 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#35 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#36 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#37 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#38 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#39 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#40 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#41 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#42 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#43 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#44 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#45 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#46 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#47 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#48 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#49 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#50 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#51 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#52 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#53 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#54 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#55 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#56 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#57 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#58 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#59 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#60 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#61 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#62 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#63 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#64 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#65 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#66 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#67 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#68 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#69 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#70 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#71 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#72 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#73 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#74 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#75 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#76 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#77 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#78 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#79 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#80 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#81 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#82 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#83 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#84 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#85 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#86 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#87 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#88 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#89 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#90 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#91 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#92 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#93 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#94 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#95 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#96 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#97 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#98 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#99 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#100 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#101 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#102 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#103 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#104 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#105 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#106 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#107 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#108 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#109 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#110 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#111 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#112 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#113 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#114 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#115 0x00000000009f5da2 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#116 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#117 0x00000000009fd619 in ?? ()
#118 0x00000000009f63ed in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#119 0x00000000009f61f6 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#120 0x00000000009f9f39 in gimplify_body(tree_node*, bool) ()
#121 0x00000000009fa376 in gimplify_function_tree(tree_node*) ()
#122 0x0000000000885f98 in cgraph_node::analyze() ()
#123 0x00000000008888b8 in ?? ()
#124 0x0000000000889503 in symbol_table::finalize_compilation_unit() ()
#125 0x0000000000c76a41 in ?? ()
#126 0x000000000060065a in toplev::main(int, char**) ()
#127 0x000000000060413c in main ()
Comment 11 myloveyuxuan 2020-06-08 14:05:08 UTC
Created attachment 643972 [details]
preprocessed file of xml_grammar.c
Comment 12 myloveyuxuan 2020-06-08 14:22:19 UTC
(In reply to Sergei Trofimovich from comment #5)
> (In reply to Sergei Trofimovich from comment #4)
> > I'll try to reproduce locally. 
> 
> 
> I was not able to reproduce locally in an -O3 -march=native chroot. That
> probably means that gcc itself was mis-compiled for your target. Try to get
> a symbolized gcc backtrace when if smashes it's sack.
> https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces should
> help in that.

Sure I can.

Here is the summary of the more information added in the new comment.

Comment 6 is the output of command `LANG=C gcc -Q --help=target`

Comment 7 is the differences between the output of the command `LANG=C gcc -Q --help=target` and the command `LANG=C gcc -march=native -Q --help=target`

Comment 8 is the output of command `LANG=C gcc -march=native -O3 -Q --help=optimizers`

Comment 9 is the differences between the output of the command `LANG=C gcc -march=native -O3 -Q --help=optimizers` and the command `LANG=C gcc -march=native -O2 -Q --help=optimizers`

Comment 10 is the symbolized gcc backtrace when smashes it's stack.

And the attachment in the Comment 11 is preprocessed file of xml_grammer.c
Comment 13 Sergei Trofimovich gentoo-dev 2020-06-08 18:04:34 UTC
(In reply to myloveyuxuan from comment #12)
> (In reply to Sergei Trofimovich from comment #5)
> > (In reply to Sergei Trofimovich from comment #4)
> > > I'll try to reproduce locally. 
> > 
> > 
> > I was not able to reproduce locally in an -O3 -march=native chroot. That
> > probably means that gcc itself was mis-compiled for your target. Try to get
> > a symbolized gcc backtrace when if smashes it's sack.
> > https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces should
> > help in that.
> 
> Sure I can.
> 
> Here is the summary of the more information added in the new comment.
> 
> Comment 6 is the output of command `LANG=C gcc -Q --help=target`
> 
> Comment 7 is the differences between the output of the command `LANG=C gcc
> -Q --help=target` and the command `LANG=C gcc -march=native -Q --help=target`
> 
> Comment 8 is the output of command `LANG=C gcc -march=native -O3 -Q
> --help=optimizers`
> 
> Comment 9 is the differences between the output of the command `LANG=C gcc
> -march=native -O3 -Q --help=optimizers` and the command `LANG=C gcc
> -march=native -O2 -Q --help=optimizers`
> 
> Comment 10 is the symbolized gcc backtrace when smashes it's stack.

Looks like it does not have line numbers attached. Usually extra debug info can be obtained if compiled with -g (or -ggdb) added to CFLAGS/CXXFLAGS.

> And the attachment in the Comment 11 is preprocessed file of xml_grammer.c

Just to clarify: you see the crash if you run gcc on a preprocessed file as well, right?

Thank you!
Comment 14 myloveyuxuan 2020-06-09 12:57:07 UTC
Created attachment 644126 [details]
The preprocessed file of xml_grammar.cpp

The output of ` "x86_64-pc-linux-gnu-g++"   -fvisibility-inlines-hidden -O3 -march=native -pipe -std=c++14 -fPIC -m64 -pthread -finline-functions -Wno-inline -Wall -fvisibility=hidden -ftemplate-depth-255 -fvisibility=hidden -fvisibility-inlines-hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_SERIALIZATION_DYN_LINK=1 -DNDEBUG  -I"." -E libs/serialization/src/xml_grammar.cpp`
Comment 15 myloveyuxuan 2020-06-09 12:57:40 UTC
Function "internal_error" not defined.
Breakpoint 1 (internal_error) pending.
Starting program: /usr/bin/x86_64-pc-linux-gnu-g++ -fvisibility-inlines-hidden -O3 -march=native -pipe -std=c++14 -fPIC -m64 -pthread -finline-functions -Wno-inline -Wall -fvisibility=hidden -ftemplate-depth-255 -fvisibility=hidden -fvisibility-inlines-hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_SERIALIZATION_DYN_LINK=1 -DNDEBUG -I. -c -o bin.v2/libs/serialization/build/gcc-10.1/gentoorelease/pch-off/threading-multi/visibility-hidden/xml_grammar.o libs/serialization/src/xml_grammar.cpp
[Attaching after process 15907 vfork to child process 15911]
[New inferior 2 (process 15911)]
[Detaching vfork parent process 15907 after child exec]
[Inferior 1 (process 15907) detached]
process 15911 is executing new program: /usr/libexec/gcc/x86_64-pc-linux-gnu/10.1.0/cc1plus

Thread 2.1 "cc1plus" received signal SIGABRT, Aborted.
[Switching to process 15911]
0x00007ffff7bc3f71 in raise () from /lib64/libc.so.6
#0  0x00007ffff7bc3f71 in raise () from /lib64/libc.so.6
#1  0x00007ffff7bad537 in abort () from /lib64/libc.so.6
#2  0x00007ffff7c08207 in ?? () from /lib64/libc.so.6
#3  0x00007ffff7c99892 in __fortify_fail () from /lib64/libc.so.6
#4  0x00007ffff7c99870 in __stack_chk_fail () from /lib64/libc.so.6
#5  0x000000000065a1f2 in cp_gimplify_expr(tree_node**, gimple**, gimple**) ()
#6  0x00000000009f4ffc in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#7  0x00000000009faeb1 in ?? ()
#8  0x00000000009f6304 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#9  0x00000000009f6196 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#10 0x00000000009f5d42 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#11 0x00000000009f6196 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#12 0x00000000009fd5b9 in ?? ()
#13 0x00000000009f638d in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#14 0x00000000009f6196 in gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ()
#15 0x00000000009f9ed9 in gimplify_body(tree_node*, bool) ()
#16 0x00000000009fa316 in gimplify_function_tree(tree_node*) ()
#17 0x0000000000885f58 in cgraph_node::analyze() ()
#18 0x0000000000888878 in ?? ()
#19 0x00000000008894c3 in symbol_table::finalize_compilation_unit() ()
#20 0x0000000000c769b1 in ?? ()
#21 0x000000000060065a in toplev::main(int, char**) ()
#22 0x000000000060413c in main ()
Comment 16 myloveyuxuan 2020-06-09 13:10:10 UTC
(In reply to Sergei Trofimovich from comment #13)
> (In reply to myloveyuxuan from comment #12)
> > (In reply to Sergei Trofimovich from comment #5)
> > > (In reply to Sergei Trofimovich from comment #4)
> > > > I'll try to reproduce locally. 
> > > 
> > > 
> > > I was not able to reproduce locally in an -O3 -march=native chroot. That
> > > probably means that gcc itself was mis-compiled for your target. Try to get
> > > a symbolized gcc backtrace when if smashes it's sack.
> > > https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces should
> > > help in that.
> > 
> > Sure I can.
> > 
> > Here is the summary of the more information added in the new comment.
> > 
> > Comment 6 is the output of command `LANG=C gcc -Q --help=target`
> > 
> > Comment 7 is the differences between the output of the command `LANG=C gcc
> > -Q --help=target` and the command `LANG=C gcc -march=native -Q --help=target`
> > 
> > Comment 8 is the output of command `LANG=C gcc -march=native -O3 -Q
> > --help=optimizers`
> > 
> > Comment 9 is the differences between the output of the command `LANG=C gcc
> > -march=native -O3 -Q --help=optimizers` and the command `LANG=C gcc
> > -march=native -O2 -Q --help=optimizers`
> > 
> > Comment 10 is the symbolized gcc backtrace when smashes it's stack.
> 
> Looks like it does not have line numbers attached. Usually extra debug info
> can be obtained if compiled with -g (or -ggdb) added to CFLAGS/CXXFLAGS.
> 
> > And the attachment in the Comment 11 is preprocessed file of xml_grammer.c
> 
> Just to clarify: you see the crash if you run gcc on a preprocessed file as
> well, right?
> 
> Thank you!

  Sorry for confusing you.

  I have realized that I followed the wrong guide before.

  So I add a new attachment which content is what Comment 14 said. 

  And I recompile gcc with `-ggdb` compiler flag and get the backtrace where the ICE happend again.

  There is something to notice, which that I retried the compile command which makes the ICE happen but the ICE does not always happen .
Comment 17 Sergei Trofimovich gentoo-dev 2020-06-09 23:30:06 UTC
Can you also check that sys-apps/memtest86+ or similar test does not report memory errors on your machine?
Comment 18 myloveyuxuan 2020-06-10 09:59:04 UTC
(In reply to Sergei Trofimovich from comment #17)
> Can you also check that sys-apps/memtest86+ or similar test does not report
> memory errors on your machine?

I just have run the sys-apps/memtest86+ for 3 hours but there is no any memory errors reported on my machine.
Comment 19 myloveyuxuan 2020-06-10 13:21:32 UTC
  Only sys-devel/gcc-10.1.0 compiling dev-libs/boost-1.73.0 will cause this issue.

  I have tried recompile all other packages on my machine without any issue.

  And I also tried to compile the sources from upstream without problem.
  
  Moreover, I recompiled gcc with **debug** use flag enabled. I can build dev-libs/boost-1.73.0 without any problem using recompiled gcc.
Comment 20 Sergei Trofimovich gentoo-dev 2020-06-10 18:07:57 UTC
(In reply to myloveyuxuan from comment #18)
> I just have run the sys-apps/memtest86+ for 3 hours but there is no any
> memory errors reported on my machine.

Aha. Nice to have it checked. Let's assume it's a software bug then.

(In reply to myloveyuxuan from comment #19)
>   Only sys-devel/gcc-10.1.0 compiling dev-libs/boost-1.73.0 will cause this
> issue.
> 
>   I have tried recompile all other packages on my machine without any issue.
> 
>   And I also tried to compile the sources from upstream without problem.
>   
>   Moreover, I recompiled gcc with **debug** use flag enabled. I can build
> dev-libs/boost-1.73.0 without any problem using recompiled gcc.

That probably means data corruption is very sensitive to code layout generated for gcc-10 itself.

Meanwhile I attempted to reproduce on zvnver2 machine with either '-march=native -O3' or '-O3 -pipe -march=znver1 -mmmx -mabm -madx -maes -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2 -msse4a -mssse3  -mavx -mavx -mbmi -mbmi2 -mclflushopt -mclzero -mcx16 -mf16c -mfma -mfsgsbase -mfxsr -mlzcnt -mmovbe -mmwaitx -mpclmul -mpopcnt -mprfchw -mrdrnd -mrdseed -msahf -msha -mtune=znver1 -mxsave -mxsavec -mxsaveopt -mxsaves -fdiagnostics-show-option -frecord-gcc-switches'. None fail for me. All work fine.

1. Does compiling preprocessed file fail for you if you run try to build it with expanded version of flags instead of -march=native?

Would be nice to find out smaller set of flags to get a clue which arch-specific flags are involved.

2. Can you post detailed USE flags for gcc and it's dependencies? 'emerge --info sys-devel/gcc sys-libs/glibc'
Comment 21 myloveyuxuan 2020-06-11 10:57:20 UTC
(In reply to Sergei Trofimovich from comment #20)
> (In reply to myloveyuxuan from comment #18)
> > I just have run the sys-apps/memtest86+ for 3 hours but there is no any
> > memory errors reported on my machine.
> 
> Aha. Nice to have it checked. Let's assume it's a software bug then.
> 
> (In reply to myloveyuxuan from comment #19)
> >   Only sys-devel/gcc-10.1.0 compiling dev-libs/boost-1.73.0 will cause this
> > issue.
> > 
> >   I have tried recompile all other packages on my machine without any issue.
> > 
> >   And I also tried to compile the sources from upstream without problem.
> >   
> >   Moreover, I recompiled gcc with **debug** use flag enabled. I can build
> > dev-libs/boost-1.73.0 without any problem using recompiled gcc.
> 
> That probably means data corruption is very sensitive to code layout
> generated for gcc-10 itself.
> 
> Meanwhile I attempted to reproduce on zvnver2 machine with either
> '-march=native -O3' or '-O3 -pipe -march=znver1 -mmmx -mabm -madx -maes
> -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2 -msse4a -mssse3  -mavx -mavx
> -mbmi -mbmi2 -mclflushopt -mclzero -mcx16 -mf16c -mfma -mfsgsbase -mfxsr
> -mlzcnt -mmovbe -mmwaitx -mpclmul -mpopcnt -mprfchw -mrdrnd -mrdseed -msahf
> -msha -mtune=znver1 -mxsave -mxsavec -mxsaveopt -mxsaves
> -fdiagnostics-show-option -frecord-gcc-switches'. None fail for me. All work
> fine.
> 
> 1. Does compiling preprocessed file fail for you if you run try to build it
> with expanded version of flags instead of -march=native?
> 
> Would be nice to find out smaller set of flags to get a clue which
> arch-specific flags are involved.
> 
> 2. Can you post detailed USE flags for gcc and it's dependencies? 'emerge
> --info sys-devel/gcc sys-libs/glibc'

1. Yeah, I have tried it. But even if I delete all flags expanded from -march=native, gcc still smashing its stack at the same place.

2. The output of 'emerge --info sys-devel/gcc sys-libs/glibc' is in the next Comment.

Something more about compilation, I tried to recompile the xml_grammar.cpp without -march=native and the ICE still happened.
Comment 22 myloveyuxuan 2020-06-11 10:58:49 UTC
Created attachment 644360 [details]
The output of `emerge --info sys-devel/gcc sys-libs/glibc`
Comment 23 myloveyuxuan 2020-06-11 11:04:22 UTC
Created attachment 644362 [details]
The error messages when I try to compile xml_grammar.cpp for five times

Only the third time I can pass the compilation.
Comment 24 Sergei Trofimovich gentoo-dev 2020-06-11 18:55:58 UTC
(In reply to myloveyuxuan from comment #22)
> Created attachment 644360 [details]
> The output of `emerge --info sys-devel/gcc sys-libs/glibc`

Looks normal (except perhaps missing -ggdb for gcc, that explains why there are no debugging symbols).

Can you somehow share a package of build and faulty gcc? It's about 70MB and can be generated by 'quickpkg gcc'. It should create a tarball.
Comment 25 myloveyuxuan 2020-06-12 02:51:39 UTC
(In reply to Sergei Trofimovich from comment #24)
> (In reply to myloveyuxuan from comment #22)
> > Created attachment 644360 [details]
> > The output of `emerge --info sys-devel/gcc sys-libs/glibc`
> 
> Looks normal (except perhaps missing -ggdb for gcc, that explains why there
> are no debugging symbols).
> 
> Can you somehow share a package of build and faulty gcc? It's about 70MB and
> can be generated by 'quickpkg gcc'. It should create a tarball.


Already sent you the package via email.
Comment 26 Sergei Trofimovich gentoo-dev 2020-06-12 21:47:02 UTC
(In reply to myloveyuxuan from comment #25)
> (In reply to Sergei Trofimovich from comment #24)
> > (In reply to myloveyuxuan from comment #22)
> > > Created attachment 644360 [details]
> > > The output of `emerge --info sys-devel/gcc sys-libs/glibc`
> > 
> > Looks normal (except perhaps missing -ggdb for gcc, that explains why there
> > are no debugging symbols).
> > 
> > Can you somehow share a package of build and faulty gcc? It's about 70MB and
> > can be generated by 'quickpkg gcc'. It should create a tarball.
> 
> 
> Already sent you the package via email.

I'm afraid I did not receive anything. Can you post a link to the archive here if possible?
Comment 27 myloveyuxuan 2020-06-13 04:53:16 UTC
(In reply to Sergei Trofimovich from comment #26)
> (In reply to myloveyuxuan from comment #25)
> > (In reply to Sergei Trofimovich from comment #24)
> > > (In reply to myloveyuxuan from comment #22)
> > > > Created attachment 644360 [details]
> > > > The output of `emerge --info sys-devel/gcc sys-libs/glibc`
> > > 
> > > Looks normal (except perhaps missing -ggdb for gcc, that explains why there
> > > are no debugging symbols).
> > > 
> > > Can you somehow share a package of build and faulty gcc? It's about 70MB and
> > > can be generated by 'quickpkg gcc'. It should create a tarball.
> > 
> > 
> > Already sent you the package via email.
> 
> I'm afraid I did not receive anything. Can you post a link to the archive
> here if possible?

OK, here is the link

https://drive.google.com/file/d/1UbaCrD_KqzOSuWst7acABDVB7SnDUSXP/view?usp=sharing
Comment 28 Sergei Trofimovich gentoo-dev 2020-06-14 07:56:45 UTC
(In reply to myloveyuxuan from comment #27)
> OK, here is the link
> 
> https://drive.google.com/file/d/1UbaCrD_KqzOSuWst7acABDVB7SnDUSXP/
> view?usp=sharing

I also mirrored it at https://dev.gentoo.org/~slyfox/bugs/724314-gcc-znver1/gcc-10.1.0.tbz2

I unpacked this gcc on top of existing one and still can't reproduce crashes on boost. Neither on preprocessed file, nor on the boost ebuild.

We can try a few other things heavyweight things:

1. Prepare complete chroot where the problem is reproducible. Then archive and share the whole chroot. I expect that to be about 500MB archive.

2. Run gcc's testsuite and compare failures with my znver system. Maybe we'll be able to spot faulty block. To do that you can build gcc with: 'FEATURES=test USE=test emerge -v1 gcc'. And the package up the whole gcc's build tree and share the archive.
Comment 29 myloveyuxuan 2020-06-22 03:32:55 UTC
Created attachment 645596 [details]
Debug log
Comment 30 myloveyuxuan 2020-06-22 03:38:36 UTC
(In reply to Sergei Trofimovich from comment #28)
> (In reply to myloveyuxuan from comment #27)
> > OK, here is the link
> > 
> > https://drive.google.com/file/d/1UbaCrD_KqzOSuWst7acABDVB7SnDUSXP/
> > view?usp=sharing
> 
> I also mirrored it at
> https://dev.gentoo.org/~slyfox/bugs/724314-gcc-znver1/gcc-10.1.0.tbz2
> 
> I unpacked this gcc on top of existing one and still can't reproduce crashes
> on boost. Neither on preprocessed file, nor on the boost ebuild.
> 
> We can try a few other things heavyweight things:
> 
> 1. Prepare complete chroot where the problem is reproducible. Then archive
> and share the whole chroot. I expect that to be about 500MB archive.
> 
> 2. Run gcc's testsuite and compare failures with my znver system. Maybe
> we'll be able to spot faulty block. To do that you can build gcc with:
> 'FEATURES=test USE=test emerge -v1 gcc'. And the package up the whole gcc's
> build tree and share the archive.

1. Sorry I can't reproduce the problem in chroot, too. 
   All the problem disappeared when I get into chroot environment but still appears in the un-chroot environment.

2. Here is the gcc's build tree when I build gcc with 'FEATURES=test USE=test emerge -v1 gcc':

https://drive.google.com/file/d/1d-ATqgN0H3ajJ9tm_yfIVrI4M9QIK1C2/view?usp=sharing

and the gdb debug log after I compile gcc with 'FEATURES="${FEATURES} splitdebug compressdebug -nostrip"' and 'USE="debug"':

https://bugs.gentoo.org/attachment.cgi?id=645596
Comment 31 Sergei Trofimovich gentoo-dev 2020-06-22 07:09:29 UTC
(In reply to myloveyuxuan from comment #30)
> (In reply to Sergei Trofimovich from comment #28)
> > (In reply to myloveyuxuan from comment #27)
> > > OK, here is the link
> > > 
> > > https://drive.google.com/file/d/1UbaCrD_KqzOSuWst7acABDVB7SnDUSXP/
> > > view?usp=sharing
> > 
> > I also mirrored it at
> > https://dev.gentoo.org/~slyfox/bugs/724314-gcc-znver1/gcc-10.1.0.tbz2
> > 
> > I unpacked this gcc on top of existing one and still can't reproduce crashes
> > on boost. Neither on preprocessed file, nor on the boost ebuild.
> > 
> > We can try a few other things heavyweight things:
> > 
> > 1. Prepare complete chroot where the problem is reproducible. Then archive
> > and share the whole chroot. I expect that to be about 500MB archive.
> > 
> > 2. Run gcc's testsuite and compare failures with my znver system. Maybe
> > we'll be able to spot faulty block. To do that you can build gcc with:
> > 'FEATURES=test USE=test emerge -v1 gcc'. And the package up the whole gcc's
> > build tree and share the archive.
> 
> 1. Sorry I can't reproduce the problem in chroot, too. 
>    All the problem disappeared when I get into chroot environment but still
> appears in the un-chroot environment.

Hm, that might hint at external component at fault like glibc, gmp, mpc or mpfr. Try to rebuild full @world in the chroot with a new compiler and CFLAGS to see if gcc build starts failing again.

> 2. Here is the gcc's build tree when I build gcc with 'FEATURES=test
> USE=test emerge -v1 gcc':
> 
> https://drive.google.com/file/d/1d-ATqgN0H3ajJ9tm_yfIVrI4M9QIK1C2/
> view?usp=sharing
> 
> and the gdb debug log after I compile gcc with 'FEATURES="${FEATURES}
> splitdebug compressdebug -nostrip"' and 'USE="debug"':
> 
> https://bugs.gentoo.org/attachment.cgi?id=645596

Thank you! That looks good. I'll try to build binaries as close as possible to these. Can you also attach a /var/log/portage/sys-devel:gcc-10.1.0-r1:20200621-044743.log build log as well? It's a symlink in the archive.
Comment 32 myloveyuxuan 2020-06-22 10:30:47 UTC
(In reply to Sergei Trofimovich from comment #31)
> (In reply to myloveyuxuan from comment #30)
> > (In reply to Sergei Trofimovich from comment #28)
> > > (In reply to myloveyuxuan from comment #27)
> > > > OK, here is the link
> > > > 
> > > > https://drive.google.com/file/d/1UbaCrD_KqzOSuWst7acABDVB7SnDUSXP/
> > > > view?usp=sharing
> > > 
> > > I also mirrored it at
> > > https://dev.gentoo.org/~slyfox/bugs/724314-gcc-znver1/gcc-10.1.0.tbz2
> > > 
> > > I unpacked this gcc on top of existing one and still can't reproduce crashes
> > > on boost. Neither on preprocessed file, nor on the boost ebuild.
> > > 
> > > We can try a few other things heavyweight things:
> > > 
> > > 1. Prepare complete chroot where the problem is reproducible. Then archive
> > > and share the whole chroot. I expect that to be about 500MB archive.
> > > 
> > > 2. Run gcc's testsuite and compare failures with my znver system. Maybe
> > > we'll be able to spot faulty block. To do that you can build gcc with:
> > > 'FEATURES=test USE=test emerge -v1 gcc'. And the package up the whole gcc's
> > > build tree and share the archive.
> > 
> > 1. Sorry I can't reproduce the problem in chroot, too. 
> >    All the problem disappeared when I get into chroot environment but still
> > appears in the un-chroot environment.
> 
> Hm, that might hint at external component at fault like glibc, gmp, mpc or
> mpfr. Try to rebuild full @world in the chroot with a new compiler and
> CFLAGS to see if gcc build starts failing again.
> 
> > 2. Here is the gcc's build tree when I build gcc with 'FEATURES=test
> > USE=test emerge -v1 gcc':
> > 
> > https://drive.google.com/file/d/1d-ATqgN0H3ajJ9tm_yfIVrI4M9QIK1C2/
> > view?usp=sharing
> > 
> > and the gdb debug log after I compile gcc with 'FEATURES="${FEATURES}
> > splitdebug compressdebug -nostrip"' and 'USE="debug"':
> > 
> > https://bugs.gentoo.org/attachment.cgi?id=645596
> 
> Thank you! That looks good. I'll try to build binaries as close as possible
> to these. Can you also attach a
> /var/log/portage/sys-devel:gcc-10.1.0-r1:20200621-044743.log build log as
> well? It's a symlink in the archive.

I think the files in the gcc-build-logs.tar.bz2 is enough. And the content of the file "build.log" in "gcc-build-logs.tar.bz2" is same as the log "/var/log/portage/sys-devel:gcc-10.1.0-r1:20200621-044743.log". So I delete the log.
Comment 33 Sergei Trofimovich gentoo-dev 2020-06-22 21:34:15 UTC
(In reply to myloveyuxuan from comment #32)
> > Thank you! That looks good. I'll try to build binaries as close as possible
> > to these. Can you also attach a
> > /var/log/portage/sys-devel:gcc-10.1.0-r1:20200621-044743.log build log as
> > well? It's a symlink in the archive.
> 
> I think the files in the gcc-build-logs.tar.bz2 is enough. And the content
> of the file "build.log" in "gcc-build-logs.tar.bz2" is same as the log
> "/var/log/portage/sys-devel:gcc-10.1.0-r1:20200621-044743.log". So I delete
> the log.

Ah, yes! That's perfect!
Comment 34 Brian Evans Gentoo Infrastructure gentoo-dev 2020-06-23 13:52:55 UTC
*** Bug 729308 has been marked as a duplicate of this bug. ***
Comment 35 Sergei Trofimovich gentoo-dev 2020-06-24 21:10:19 UTC
Let's own the bug by toolchain@.
Comment 36 Sergei Trofimovich gentoo-dev 2020-06-24 22:28:02 UTC
I was not able to reproduce locally and still have not much clue. Jakub on #gcc suggested catching the place where stack corruption happens.

It is straightforward if corruption is deterministic and less straightforward if it jumps around.

We will need to find an address of stack canary that gets corrupted every time and set a watchpoint on it at the beginning of gimplify_expr() when it parses our expression.

Given that it's quite generic function it will require some a bit of trial an error.

I suggest doing the following:

1. Try to minimize preprocessed example to ease interactive gcc debugging with gdb. https://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide#.5Bbonus.5D_minimize_self-contained_source_using_creduce . The catch there is to get the property.

2. Step through minimized example to see where stack canary is corrupted. The overall process is similar to https://bugs.gentoo.org/721570#c7 (example for arm64 architecture). But the details are different.
Comment 37 Sergei Trofimovich gentoo-dev 2020-06-25 22:52:43 UTC
I see that both reports have early Ryzen CPus:

- System uname: Linux-5.7.2-gentoo-x86_64-AMD_Ryzen_5_1600_Six-Core_Processor-with-gentoo-2.7 (April 2017?)
- System uname: Linux-5.6.15-gentoo-x86_64-x86_64-AMD_Ryzen_5_2500U_with_Radeon_Vega_Mobile_Gfx-with-glibc2.2.5  (November 2017?)

Internets say that some early CPUs had bugs that cause crashes under the load: https://community.amd.com/thread/219812. 

If MAKEOPTS=-j1 makes the boost crash disappear that might be a point in favour of CPU bug. I don't know if there is a nice benchmark to detect if your CPU is really affected.
Comment 38 user.light.man 2020-06-26 08:57:10 UTC
I tried to compile with MAKEOPTS=-j1, but it crashes anyway
Comment 39 Sergei Trofimovich gentoo-dev 2020-06-26 09:14:08 UTC
Aha, that has a better chance of being software bug. Can you extract gdb backtrace to make sure it looks similar enough to https://bugs.gentoo.org/attachment.cgi?id=645596 ?
Comment 40 user.light.man 2020-06-26 12:44:17 UTC
I don't know why, but boost compiled without errors. Before that I compiled gcc with 'debug' use-flag and I added flag -ggdb to COMMON_FLAGS in the make.conf
Comment 41 Sergei Trofimovich gentoo-dev 2020-06-26 16:06:59 UTC
(In reply to user.light.man from comment #40)
> I don't know why, but boost compiled without errors. Before that I compiled
> gcc with 'debug' use-flag and I added flag -ggdb to COMMON_FLAGS in the
> make.conf

Can you clarify: boost was failing with gcc USE=debug/-ggdb or it succeeded when you changed to gcc USE=debug/-ggdb?
Comment 42 user.light.man 2020-06-26 16:11:12 UTC
the second, successfully compiled
Comment 43 user.light.man 2020-06-26 17:53:30 UTC
stack smashing happens again, but now in a program what I write
Comment 44 user.light.man 2020-06-26 18:02:48 UTC
oh no, it is not related with this problem, sorry
Comment 45 myloveyuxuan 2020-06-27 12:56:38 UTC
(In reply to Sergei Trofimovich from comment #37)
> I see that both reports have early Ryzen CPus:
> 
> - System uname:
> Linux-5.7.2-gentoo-x86_64-AMD_Ryzen_5_1600_Six-Core_Processor-with-gentoo-2.
> 7 (April 2017?)
> - System uname:
> Linux-5.6.15-gentoo-x86_64-x86_64-
> AMD_Ryzen_5_2500U_with_Radeon_Vega_Mobile_Gfx-with-glibc2.2.5  (November
> 2017?)
> 
> Internets say that some early CPUs had bugs that cause crashes under the
> load: https://community.amd.com/thread/219812. 
> 
> If MAKEOPTS=-j1 makes the boost crash disappear that might be a point in
> favour of CPU bug. I don't know if there is a nice benchmark to detect if
> your CPU is really affected.

I have tried reinstalling the system, building boost with MAKEOPTS="-j1" and without any other heavy work running at the same time, but the problem is still there.
Comment 46 Sergei Trofimovich gentoo-dev 2020-06-27 13:07:54 UTC
Perhaps try to minimise preprocessed example using https://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide#.5Bbonus.5D_minimize_self-contained_source_using_creduce . That should ease manual inspection where gcc crashes.
Comment 47 user.light.man 2020-06-27 15:05:51 UTC
I tried again.
I built gcc without debug-flag. When I compile boost, a crash happens.
Now I've built gcc with debug-flag. The compilation of boost succeeded.
It occurs only in a non-debug build. -ggdb option doesn't matter
Comment 48 Sergei Trofimovich gentoo-dev 2020-07-03 20:55:39 UTC
In search for other clues, do you happen to have sys-devel/llvmgold installed on affected systems? That automatically installs a plugin into binutils that should not but might affect gcc.
Comment 49 myloveyuxuan 2020-07-05 10:22:17 UTC
(In reply to Sergei Trofimovich from comment #48)
> In search for other clues, do you happen to have sys-devel/llvmgold
> installed on affected systems? That automatically installs a plugin into
> binutils that should not but might affect gcc.

I don't have sys-devel/llvmgold installed on affected systems.
And I can't install creduce because some bugs that have to repair.
Comment 50 user.light.man 2020-07-05 10:44:14 UTC
eix sys-devel/llvmgold
[I] sys-devel/llvmgold
     Available versions:  8 9 (~)10 **11*l
     Installed versions:  10(04:28:19 PM 05/29/2020)
     Homepage:            https://llvm.org/
     Description:         LLVMgold plugin symlink for autoloading
Comment 51 Sergei Trofimovich gentoo-dev 2020-07-05 19:09:46 UTC
(In reply to user.light.man from comment #50)
> eix sys-devel/llvmgold
> [I] sys-devel/llvmgold
>      Available versions:  8 9 (~)10 **11*l
>      Installed versions:  10(04:28:19 PM 05/29/2020)
>      Homepage:            https://llvm.org/
>      Description:         LLVMgold plugin symlink for autoloading

Can you try to deinstall it for a period of a short test:
- rebuilding gcc
- rebuiding glibc
- rebuilding boost
and check if boost still fails to build.
Comment 52 user.light.man 2020-07-06 09:00:57 UTC
I made these steps, it still fails
Comment 53 myloveyuxuan 2020-07-07 04:38:32 UTC
  I tried compile gcc with all kinds of combinations of USE flags. Finally I can make sure that the ICE disappears when I enable the **debug** USE flag. 
  I am lack of knowledge about what EBUILD do with debug USE flag. So I would like believe that you can find the solution.
  Thank you.
Comment 54 Stig Nielsen 2020-07-07 05:48:01 UTC
Hi, just to make sure. You had only the debug flag enabled or where the other flags as well?
Comment 55 Sergei Trofimovich gentoo-dev 2020-07-07 06:29:27 UTC
(In reply to myloveyuxuan from comment #53)
>   I tried compile gcc with all kinds of combinations of USE flags. Finally I
> can make sure that the ICE disappears when I enable the **debug** USE flag. 
>   I am lack of knowledge about what EBUILD do with debug USE flag. So I
> would like believe that you can find the solution.
>   Thank you.

Unfortunately, no. The USE=debug only changes gcc's code enough make real bug invisible (but still very present in gcc). We need to understand why the bug happens and extract smallest example that exhibits the bug.
Comment 56 myloveyuxuan 2020-07-07 06:37:34 UTC
(In reply to Stig Nielsen from comment #54)
> Hi, just to make sure. You had only the debug flag enabled or where the
> other flags as well?

Other flags may have no effects on it.
I have tried enabling debug USE flag with profile 
default/linux/amd64/17.1/desktop/plasma, then compilation passed.
But then I disable debug USE flag, it appeared again.
So I tried enable only debug USE and other essential USE flags of gcc for compiling boost; the compilation passed.
Then I tried disable debug USE, it appeared expectedly.
Comment 57 myloveyuxuan 2020-07-07 06:39:11 UTC
(In reply to Sergei Trofimovich from comment #55)
> (In reply to myloveyuxuan from comment #53)
> >   I tried compile gcc with all kinds of combinations of USE flags. Finally I
> > can make sure that the ICE disappears when I enable the **debug** USE flag. 
> >   I am lack of knowledge about what EBUILD do with debug USE flag. So I
> > would like believe that you can find the solution.
> >   Thank you.
> 
> Unfortunately, no. The USE=debug only changes gcc's code enough make real
> bug invisible (but still very present in gcc). We need to understand why the
> bug happens and extract smallest example that exhibits the bug.

I will try my best to do that.
But it probably makes debugging harder
Comment 58 Sergei Trofimovich gentoo-dev 2020-07-21 23:12:29 UTC
I added a https://wiki.gentoo.org/wiki/Project:Toolchain/724314-gcc-10-and-znver1#More_info to get some hints how to extract more info to debug it further.

Specifically we need to track down where stack gets corrupted: https://wiki.gentoo.org/wiki/Stack-smashing-debugging-guide
Comment 59 myloveyuxuan 2020-09-04 15:13:49 UTC
Seems that upstream has fixed it.
Comment 60 Sergei Trofimovich gentoo-dev 2020-09-04 19:36:31 UTC
(In reply to myloveyuxuan from comment #59)
> Seems that upstream has fixed it.

Do you have a link to the fix?
Comment 61 myloveyuxuan 2020-09-07 09:24:07 UTC
(In reply to Sergei Trofimovich from comment #60)
> (In reply to myloveyuxuan from comment #59)
> > Seems that upstream has fixed it.
> 
> Do you have a link to the fix?

Here is the link: https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=08f594eb399dab06
Comment 62 Sergei Trofimovich gentoo-dev 2020-09-07 13:46:33 UTC
(In reply to myloveyuxuan from comment #61)
> (In reply to Sergei Trofimovich from comment #60)
> > (In reply to myloveyuxuan from comment #59)
> > > Seems that upstream has fixed it.
> > 
> > Do you have a link to the fix?
> 
> Here is the link:
> https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=08f594eb399dab06

How did you find it? That commit was already present in gcc-10.1.0

$ git tag --contains=08f594eb399dab06 | cat
basepoints/gcc-11
misc/cutover-git
releases/gcc-10.1.0
releases/gcc-10.2.0