Summary: | cross-msp430-elf/gcc-7.3.0-r3 fails to build: "internal compiler error: in simplify_subreg, at simplify-rtx.c:6014" (USE=cxx) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Alex Orange <crazycasta> |
Component: | Current packages | Assignee: | Gentoo Crossdev team <crossdev> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | jstein, slyfox |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | https://gcc.gnu.org/PR79242 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 627914 | ||
Attachments: |
build.log
environment gcc-build-logs.tar.bz2 |
Description
Alex Orange
2018-08-19 05:45:30 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" Created attachment 543974 [details]
build.log
Created attachment 543976 [details]
environment
Created attachment 543978 [details]
gcc-build-logs.tar.bz2
(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? 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. 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. 2. cross-msp430-elf/gcc-8.2.0-r2 compiles fine. So it appears to be a problem with 7.3.0-r3. And finally, no big surprise, but 7.3.0-r4 doesn't work either. (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. 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. 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 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. 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(+) 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! 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(+) |