Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 723738

Summary: sys-devel/gcc-10.1.0 fails to build with combined lto and pgo flags if fortran flag is present (possible race)
Product: Gentoo Linux Reporter: Andy Pettinger <fingerfehler>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED OBSOLETE    
Severity: normal CC: ab4bd, fingerfehler, jstein, vityokster
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info
gcc-build-logs

Description Andy Pettinger 2020-05-18 11:36:27 UTC
Gcc-10.1.0 can build without problem using lto and pgo separately.
But attempts to use flags together both result in failure.

 

Reproducible: Always




 sys-devel/gcc-10.1.0:10::gentoo  USE="(cxx) fortran graphite hardened lto* nls nptl openmp pgo (pie) sanitize (ssp) vtv (-ada) (-altivec) -d -debug -doc (-fixed-point) -go (-jit) (-libssp) (-multilib) -objc -objc++ -objc-gc (-pch) -systemtap -test -vanilla -zstd" 

[01m[K/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/expr.c:12680:1:[m[K [01;31m[Kerror: [m[Kcorrupted profile info: profile data is not flow-consistent
12680 | [01;31m[K}[m[K
      | [01;31m[K^[m[K
[01m[K/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/expr.c:12680:1:[m[K [01;31m[Kerror: [m[Kcorrupted profile info: number of executions for edge 14-15 thought to be 1370152
[01m[K/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/expr.c:12680:1:[m[K [01;31m[Kerror: [m[Kcorrupted profile info: number of executions for edge 14-20 thought to be -3
[01m[K/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/expr.c:12680:1:[m[K [01;31m[Kerror: [m[Kcorrupted profile info: number of iterations for basic block 20 thought to be -3
/var/tmp/portage/sys-devel/gcc-10.1.0/work/build/./prev-gcc/xg++ -B/var/tmp/portage/sys-devel/gcc-10.1.0/work/build/./prev-gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -nostdinc++ -B/var/tmp/portage/sys-devel/gcc-10.1.0/work/build/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -B/var/tmp/portage/sys-devel/gcc-10.1.0/work/build/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs  -I/var/tmp/portage/sys-devel/gcc-10.1.0/work/build/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu  -I/var/tmp/portage/sys-devel/gcc-10.1.0/work/build/prev-x86_64-pc-linux-gnu/libstdc++-v3/include  -I/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/libstdc++-v3/libsupc++ -L/var/tmp/portage/sys-devel/gcc-10.1.0/work/build/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/var/tmp/portage/sys-devel/gcc-10.1.0/work/build/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -fno-PIE -c -fno-PIE -DEXTRA_OPTIONS     -m64 -march=native -pipe -O2 -fprofile-use -flto=jobserver -frandom-seed=1 -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc -I/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/. -I/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/../include -I/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/../libcpp/include  -I/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/../libdecnumber -I/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/../libdecnumber/bid -I../libdecnumber -I/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/../libbacktrace   -o gimple-ssa-backprop.o -MT gimple-ssa-backprop.o -MMD -MP -MF ./.deps/gimple-ssa-backprop.TPo /var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/gimple-ssa-backprop.c
make[3]: *** [Makefile:1119: expr.o] Error 1
make[3]: *** Waiting for unfinished jobs....
/bin/bash /var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/../move-if-change tmp-attrtab.c    insn-attrtab.c
/bin/bash /var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/../move-if-change tmp-dfatab.c     insn-dfatab.c
/bin/bash /var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/../move-if-change tmp-latencytab.c insn-latencytab.c
echo timestamp > s-attrtab
rm gcc.pod gfortran.pod
make[3]: Leaving directory '/var/tmp/portage/sys-devel/gcc-10.1.0/work/build/gcc'
make[2]: *** [Makefile:4990: all-stagefeedback-gcc] Error 2
make[2]: Leaving directory '/var/tmp/portage/sys-devel/gcc-10.1.0/work/build'
make[1]: *** [Makefile:24441: stagefeedback-bubble] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-devel/gcc-10.1.0/work/build'
make: *** [Makefile:24461: profiledbootstrap] Error 2
 * ERROR: sys-devel/gcc-10.1.0::gentoo failed (compile phase):
 *   emake failed
Comment 1 Andy Pettinger 2020-05-18 11:38:11 UTC
Created attachment 640132 [details]
emerge --info
Comment 2 Andy Pettinger 2020-05-18 11:41:59 UTC
Created attachment 640136 [details]
gcc-build-logs
Comment 3 Andy Pettinger 2020-05-18 13:16:38 UTC
With -fortran flag gcc builds with combined pgo lto flags

Changed title of bug
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2020-05-19 06:39:50 UTC
"""
/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/expr.c: In function ‘wi::lrshift<generic_wide_int<wide_int_storage>, int>(generic_wide_int<wide_int_storage> const&, int const&)wi::binary_traits<generic_wide_int<wide_int_storage>, generic_wide_int<wide_int_storage>, wi::int_traits<generic_wide_int<wide_int_storage> >::precision_type, wi::int_traits<generic_wide_int<wide_int_storage> >::precision_type>::result_type’:
/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/expr.c:12680:1: error: corrupted profile info: profile data is not flow-consistent
12680 | }
      | ^
/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/expr.c:12680:1: error: corrupted profile info: number of executions for edge 14-15 thought to be 1370152
/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/expr.c:12680:1: error: corrupted profile info: number of executions for edge 14-20 thought to be -3
/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/expr.c:12680:1: error: corrupted profile info: number of iterations for basic block 20 thought to be -3
"""

Looks like a corrupted profile trace (or just bad generated profile). Neither should happen.

1. Is it consistently reproducible for you on the same file(s)?
2. Does MAKEOPTS=-j1 work as a workaround?
Comment 5 Andy Pettinger 2020-05-19 07:09:38 UTC
This morning with 

sys-devel/gcc-10.1.0:10::gentoo  USE="(cxx) fortran* graphite hardened lto nls nptl openmp pgo (pie) sanitize (ssp) vtv (-ada) (-altivec) -d -debug -doc (-fixed-point) -go (-jit) (-libssp) (-multilib) -objc -objc++ -objc-gc (-pch) -systemtap -test -vanilla -zstd" 0 KiB

I get a similar but not identical error 

/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/expr.c: In function ‘wi::lrshift<generic_wide_int<wide_int_storage>, int>(generic_wide_int<wide_int_storage> const&, int const&)wi::binary_traits<generic_wide_int<wide_int_storage>, generic_wide_int<wide_int_storage>, wi::int_traits<generic_wide_int<wide_int_storage> >::precision_type, wi::int_traits<generic_wide_int<wide_int_storage> >::precision_type>::result_type’:
/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/expr.c:12680:1: error: corrupted profile info: profile data is not flow-consistent
12680 | }
      | ^
/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/expr.c:12680:1: error: corrupted profile info: number of executions for edge 14-15 thought to be 1370150
/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/expr.c:12680:1: error: corrupted profile info: number of executions for edge 14-20 thought to be -1
/var/tmp/portage/sys-devel/gcc-10.1.0/work/gcc-10.1.0/gcc/expr.c:12680:1: error: corrupted profile info: number of iterations for basic block 20 thought to be -1

I'll report back with MAKEOPTS="-j1"

Many thanks Andy
Comment 6 Andy Pettinger 2020-05-20 03:55:12 UTC
MAKEOPTS="-j1" worked.  Sorry for the false alarm.

This particular combination of flags with 10.1.0 seems sensitive on my machine.
Comment 7 Sergei Trofimovich (RETIRED) gentoo-dev 2020-05-20 06:28:07 UTC
(In reply to Andy Pettinger from comment #6)
> MAKEOPTS="-j1" worked.

Woohoo! I was afraid of that.

> Sorry for the false alarm. This particular combination of flags with 10.1.0 seems sensitive on my
> machine.

Oh, I think your configuration is totally fine and gcc should be fixed. It's just hard to reproduce and debug on my machine :)
Comment 8 Andreas K. Hüttel archtester gentoo-dev 2023-08-23 17:42:16 UTC
Please make a new bug if this still exists in current gcc.