/var/tmp/portage/sys-devel/gcc-7.2.0/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-7.2.0/work/build/./gcc/ -nostdinc -x c /dev/null -S -o /dev/null -fself-test=/var/tmp/portage/sys-devel/gcc-7.2.0/work/gcc-7.2.0/gcc/testsuite/selftests /var/tmp/portage/sys-devel/gcc-7.2.0/work/gcc-7.2.0/gcc/function-tests.c:357: verify_three_block_cfg: FAIL: ASSERT_EQ ((3), (((fun)->cfg->x_n_basic_blocks))) cc1: internal compiler error: in fail, at selftest.c:46 Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.gentoo.org/> for instructions. ------------------------------------------------------------------- This is an unstable amd64 chroot image at a tinderbox (==build bot) name: 17.0-no-multilib-hardened_libressl-test_20180107-170619 ------------------------------------------------------------------- gcc-config -l: [1] x86_64-pc-linux-gnu-6.4.0 * Available Python interpreters, in order of preference: [1] python3.5 [2] python2.7 (fallback) emerge -qpv sys-devel/gcc [ebuild R ] sys-devel/gcc-6.4.0 USE="cxx debug* hardened nls nptl openmp (pie) (ssp) vtv (-altivec) (-awt) -cilk -doc (-fixed-point) -fortran (-gcj) -go -graphite (-jit) (-libssp) -mpx (-multilib) -objc -objc++ -objc-gc (-pch) -pgo -regression-test (-sanitize) -vanilla"
Created attachment 513670 [details] emerge-info.txt
Created attachment 513672 [details] emerge-history.txt
Created attachment 513674 [details] environment
Created attachment 513676 [details] etc.portage.tbz2
Created attachment 513678 [details] logs.tbz2
Created attachment 513680 [details] sys-devel:gcc-7.2.0:20180107-161618.log
Created attachment 513682 [details] temp.tbz2
Is it easily reproducible on your side? I tried locally with -march=native and it did not break. Can you post our output of: $ gcc -Q -O2 --help=target -march=native $ gcc -Q -O2 --help=optimizers -march=native
(In reply to Sergei Trofimovich from comment #8) > Is it easily reproducible on your side? > > I tried locally with -march=native and it did not break. Can you post our > output of: > > $ gcc -Q -O2 --help=target -march=native > $ gcc -Q -O2 --help=optimizers -march=native Ah, please disregard that. It's USE=debug! Now it crashes for me the same way.
(In reply to Sergei Trofimovich from comment #9) > (In reply to Sergei Trofimovich from comment #8) > > Is it easily reproducible on your side? > > > > I tried locally with -march=native and it did not break. Can you post our > > output of: > > > > $ gcc -Q -O2 --help=target -march=native > > $ gcc -Q -O2 --help=optimizers -march=native > > Ah, please disregard that. It's USE=debug! Now it crashes for me the same > way. Poked a bit more: it's caused by -fstack-protector-all injected by this patch and enabled via EXTRA_OPTS: https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/gcc/7.2.0/gentoo/55_all_extra-options.patch?revision=1.1&view=markup GCC test assumes CFG has 3 entries: /* Verify that we have a simple 3-block CFG: the two "fake" ones, and a "real" one: [ENTRY] -> [block2] -> [EXIT]. */ static void verify_three_block_cfg (function *fun) { ASSERT_TRUE (fun->cfg != NULL); ASSERT_EQ (3, n_basic_blocks_for_fn (fun)); The assert fails because n_basic_blocks_for_fn (fun) is 5. I guess it's our entry/exit stack checks. Reassigning to hardened@ to either #ifdef out failed debug tests or do them more robust.
(In reply to Sergei Trofimovich from comment #10) Which looks a little bit like the same like a recent patch for the Linux kernel (commit id 3ce120b16cc5484) : Makefile:KBUILD_CFLAGS += $(call cc-option,-fno-stack-check,) to overcome a boot error of Gentoo hardened linux boxes.
This failure happes not due to gcc being built wit stack check, but due to codegen inserts stack checks by default (./configure --enable-default-ssp). I tried to reproduce it on gcc-9 and do not observe the error. Test did not seem to have changed since. My guess it's because hardened switched from fstack-protector-all to -fstack-protector-strong by defaut. Closing as OBSOLETE.