Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 664014 - cross-msp430-elf/gcc-7.3.0-r3 fails to build: "internal compiler error: in simplify_subreg, at simplify-rtx.c:6014" (USE=cxx)
Summary: cross-msp430-elf/gcc-7.3.0-r3 fails to build: "internal compiler error: in si...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Gentoo Crossdev team
URL: https://gcc.gnu.org/PR79242
Whiteboard:
Keywords:
Depends on:
Blocks: crossdev-bugs
  Show dependency tree
 
Reported: 2018-08-19 05:45 UTC by Alex Orange
Modified: 2018-10-20 12:04 UTC (History)
2 users (show)

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


Attachments
build.log (build.log.gz,108.50 KB, application/gzip)
2018-08-19 05:51 UTC, Alex Orange
Details
environment (environment,159.55 KB, text/plain)
2018-08-19 05:51 UTC, Alex Orange
Details
gcc-build-logs.tar.bz2 (gcc-build-logs.tar.bz2,179.63 KB, application/x-bzip)
2018-08-19 05:52 UTC, Alex Orange
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Orange 2018-08-19 05:45:30 UTC
As in the title, cross-msp430-elf/gcc-7.3.0-r3 fails to build giving the message: "internal compiler error: in simplify_subreg, at simplify-rtx.c:6014".

Reproducible: Always

Steps to Reproduce:
1. emerge -1av cross-msp430-elf/gcc-7.3.0-r3
2.
3.
Actual Results:  
Fails with message above

Expected Results:  
Builds

Portage 2.3.40 (python 2.7.14-final-0, default/linux/amd64/17.0/desktop, gcc-6.4.0, glibc-2.26-r7, 4.14.63-gentoo-r1 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.14.63-gentoo-r1-x86_64-Intel-R-_Core-TM-_i7-4770HQ_CPU_@_2.20GHz-with-gentoo-2.4.1
KiB Mem:    16347032 total,    231456 free
KiB Swap:   16777212 total,  16777212 free
Timestamp of repository gentoo: Sun, 19 Aug 2018 05:30:01 +0000
Head commit of repository gentoo: 6a16ee173372204d8d89e1ac505d3c28b59436ac
sh bash 4.4_p12
ld GNU ld (Gentoo 2.30 p2) 2.30.0
app-shells/bash:          4.4_p12::gentoo
dev-lang/perl:            5.24.3-r1::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.5.5::gentoo, 3.6.5::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.9.6-r5::gentoo, 1.11.6-r3::gentoo, 1.13.4-r2::gentoo, 1.15.1-r2::gentoo
sys-devel/binutils:       2.30-r2::gentoo
sys-devel/gcc:            6.4.0-r1::gentoo, 7.3.0-r3::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r3::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r7::gentoo
Repositories:

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

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

das-labor
    location: /var/lib/layman/das-labor
    masters: gentoo
    priority: 50

Installed sets: @earthenterprise, @msp430
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=haswell -mtune=haswell -O3 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=haswell -mtune=haswell -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.mirrors.easynews.com/linux/gentoo/ http://gentoo.mirrors.tds.net/gentoo http://cosmos.illinois.edu/pub/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam flac fortran gdbm gif glamor gpm gtk iconv ipv6 jpeg lcms ldap libnotify libtirpc mad mmx mng modules mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds qt5 readline rsync-verify sdl seccomp spell sse sse2 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64" 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 plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev synaptics wacom" 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="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_5 python3_6" RUBY_TARGETS="ruby23" USERLAND="GNU" VIDEO_CARDS="intel i965" 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, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Alex Orange 2018-08-19 05:46:07 UTC
emerge -pqv '=cross-msp430-elf/gcc-7.3.0-r3::local-overlay'

[ebuild  NS   ] cross-msp430-elf/gcc-7.3.0-r3 [6.4.0-r1] USE="cxx multilib nls nptl pch pie ssp (-altivec) -cilk -debug -doc (-fixed-point) -fortran -go -graphite -hardened -jit -libssp -mpx -objc -objc++ -objc-gc -openmp -pgo -regression-test -sanitize -vanilla -vtv"
Comment 2 Alex Orange 2018-08-19 05:51:25 UTC
Created attachment 543974 [details]
build.log
Comment 3 Alex Orange 2018-08-19 05:51:42 UTC
Created attachment 543976 [details]
environment
Comment 4 Alex Orange 2018-08-19 05:52:57 UTC
Created attachment 543978 [details]
gcc-build-logs.tar.bz2
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2018-08-19 19:16:04 UTC
(In reply to Alex Orange from comment #0)
> As in the title, cross-msp430-elf/gcc-7.3.0-r3 fails to build giving the
> message: "internal compiler error: in simplify_subreg, at
> simplify-rtx.c:6014".

I tried to reproduce it locally and did not succeed. Can you try a few tweaks to your defaults setup?

> CFLAGS="-march=haswell -mtune=haswell -O3 -pipe"
> CXXFLAGS="-march=haswell -mtune=haswell -O3 -pipe"

1. Does cross-compiler building fail the same with
    C{,XX}FLAGS="-O2 -pipe"?

2. Does cross-msp430-elf/gcc-8.2.0-r2 fail the same?
Comment 6 Alex Orange 2018-08-26 02:56:12 UTC
My apologies for the delay, I missed the update.

1. I ran: CFLAGS="-O2 -pipe" CXXFLAGS="-O2 -pipe" emerge -1av cross-msp430-elf/gcc

with the same result.

/var/tmp/portage/cross-msp430-elf/gcc-7.3.0-r3/work/gcc-7.3.0/libstdc++-v3/libsupc++/vec.cc: In function ‘std::size_t __cxxabiv1::{anonymous}::compute_size(std::size_t, std::size_t, std::size_t)’:
/var/tmp/portage/cross-msp430-elf/gcc-7.3.0-r3/work/gcc-7.3.0/libstdc++-v3/libsupc++/vec.cc:67:41: internal compiler error: in simplify_subreg, at simplify-rtx.c:6014
       if (element_size && element_count > std::size_t(-1) / element_size)
                           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I'll report back after #2 passes or fails.
Comment 7 Alex Orange 2018-08-26 02:59:23 UTC
Also, I should ask, do our USEs match? I've had to -sanitize -openmp -vtv -fortran from gcc in the past to get it to compile. I wouldn't be surprised if I need to remove more USE flag.
Comment 8 Alex Orange 2018-08-26 05:11:57 UTC
2. cross-msp430-elf/gcc-8.2.0-r2 compiles fine. So it appears to be a problem with 7.3.0-r3.
Comment 9 Alex Orange 2018-08-26 07:43:20 UTC
And finally, no big surprise, but 7.3.0-r4 doesn't work either.
Comment 10 Sergei Trofimovich (RETIRED) gentoo-dev 2018-08-26 10:21:39 UTC
(In reply to Alex Orange from comment #7)
> Also, I should ask, do our USEs match? I've had to -sanitize -openmp -vtv
> -fortran from gcc in the past to get it to compile. I wouldn't be surprised
> if I need to remove more USE flag.

Oh, good point! I only now noticed I didn't have USE=cxx. I guess you did --stage4 crossdev install of this target (the default for bare-metal is --stage2).

Now I've reproduced the failure as well.
Comment 11 Sergei Trofimovich (RETIRED) gentoo-dev 2018-08-26 11:00:39 UTC
Followed https://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide and reduced to the following minimal test:

$ cat vec.ii
typedef __int20 unsigned a;
int b, c(c > a(-1) / b);


$ /tmp/portage/cross-msp430-elf/gcc-7.3.0-r4/work/build/./gcc/xgcc -B/tmp/portage/cross-msp430-elf/gcc-7.3.0-r4/work/build/gcc         -mlarge     -c vec.ii     -o vec.o
vec.ii: In function ‘void __static_initialization_and_destruction_0(int, int)’:
vec.ii:2:12: internal compiler error: in simplify_subreg, at simplify-rtx.c:6014
 int b, c(c > a(-1) / b);
          ~~^~~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.

Now bisecting gcc to see where it was fixed upstream.
Comment 12 Sergei Trofimovich (RETIRED) gentoo-dev 2018-08-26 11:06:27 UTC
Or the same without c++ involved:

$ cat vec.i
typedef __int20 unsigned a;
d() { int b, c = c > (a)-1 / b; }

$ /tmp/portage/cross-msp430-elf/gcc-7.3.0-r4/work/build/./gcc/xgcc -B/tmp/portage/cross-msp430-elf/gcc-7.3.0-r4/work/build/gcc  -mlarge -c vec.i vec.i
vec.i: In function ‘d’:
vec.i:2:20: internal compiler error: in simplify_subreg, at simplify-rtx.c:6014
Comment 13 Sergei Trofimovich (RETIRED) gentoo-dev 2018-08-26 12:09:19 UTC
gcc-7 branch works, gcc-7.3.0 tag crashes. Bisected the fix down to:
    https://github.com/gcc-mirror/gcc/commit/59f5415b4462a60d9f2dd6dc5229247da183b9fc

Which its an upstream fix of https://gcc.gnu.org/PR79242

Next gcc release will contain this fix. Fix looks trivial to pull into 7.3.0 as well.
Comment 14 Larry the Git Cow gentoo-dev 2018-08-26 12:16:41 UTC
The bug has been referenced in the following commit(s):

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

commit 2189e27f491ed8774f46a47b3ceca258c911137a
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2018-08-26 12:14:57 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2018-08-26 12:14:57 +0000

    7.3.0: fix partial int in msp430, bug #664014
    
    Reported-by:  Alex Orange
    Bug: https://bugs.gentoo.org/664014
    Bug: https://gcc.gnu.org/PR79242
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 7.3.0/gentoo/98_all_msp430-partial-int.patch | 72 ++++++++++++++++++++++++++++
 7.3.0/gentoo/README.history                  |  2 +
 2 files changed, 74 insertions(+)
Comment 15 Sergei Trofimovich (RETIRED) gentoo-dev 2018-08-26 12:20:41 UTC
The fix should be available in next gcc patchset bump.

Meanwhile you can drop the patch
    https://gitweb.gentoo.org/proj/gcc-patches.git/plain/7.3.0/gentoo/98_all_msp430-partial-int.patch
into
    /etc/portage/patches/cross-msp430-elf/gcc:7.3.0/
directory and test if gcc builds/works fine.

Thanks for the report!
Comment 16 Larry the Git Cow gentoo-dev 2018-09-23 22:36:23 UTC
The bug has been referenced in the following commit(s):

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

commit fd1aa67de92c05d6a066e84ba5cd4236e637629e
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2018-09-23 20:48:40 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2018-09-23 22:35:58 +0000

    sys-devel/gcc: cut 1.7 patchset for 7.3.0
    
    Three new patches:
    + 98_all_msp430-partial-int.patch:
      fix msp430 code generator on complex types
    + 99_all_x32-fix-eh-return-address.patch
      fix exception handler ABI on x32
    + 100_all_respect-build-cxxflags.patch
      fix cross-build for arch-specific CXXFLAGS
    
    Bug: https://bugs.gentoo.org/664014
    Bug: https://bugs.gentoo.org/664016
    Bug: https://bugs.gentoo.org/581406
    Package-Manager: Portage-2.3.49, Repoman-2.3.11

 sys-devel/gcc/Manifest            |  1 +
 sys-devel/gcc/gcc-7.3.0-r5.ebuild | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)