https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87836
Bug ID: 87836 Summary: ICE in cc1 for gcc-6.5.0 with SPARC hardware Product: gcc Version: 6.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: gary_mills at fastmail dot fm Target Milestone: --- Here's information on the compiler: <mills@t2000:941>$ /export/home/mills/Downloads/code/oi-userland/components/developer/gcc-6/build/sparcv7/./gcc/xgcc --version xgcc (OpenIndiana 6.5.0-OI-4) 6.5.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. <mills@t2000:944>$ -6/build/sparcv7/./gcc/xgcc -v < Using built-in specs. COLLECT_GCC=/export/home/mills/Downloads/code/oi-userland/components/developer/gcc-6/build/sparcv7/./gcc/xgcc Target: sparc-sun-solaris2.11 Configured with: /export/home/mills/Downloads/code/oi-userland/components/developer/gcc-6/gcc-6.5.0/configure CC=/usr/gcc/4.9/bin/gcc CXX=/usr/gcc/4.9/bin/g++ F77=/usr/gcc/4.9/bin/gfortran FC=/usr/gcc/4.9/bin/gfortran CFLAGS='-g -O2' CXXFLAGS=' ' FFLAGS=' ' FCFLAGS= LDFLAGS=-m32 PKG_CONFIG_PATH=/usr/lib/pkgconfig --prefix=/usr/gcc/6 --mandir=/usr/gcc/6/share/man --bindir=/usr/gcc/6/bin --libdir=/usr/gcc/6/lib --sbindir=/usr/gcc/6/sbin --sbindir=/usr/gcc/6/bin --libdir=/usr/gcc/6/lib --libexecdir=/usr/gcc/6/lib --host sparc-sun-solaris2.11 --build sparc-sun-solaris2.11 --target sparc-sun-solaris2.11 --with-pkgversion='OpenIndiana 6.5.0-OI-4' --with-bugurl=https://bugs.openindiana.org --enable-plugins --enable-objc-gc --enable-initfini-array --enable-languages=c,c++,fortran,lto,objc --without-gnu-ld --with-ld=/usr/bin/ld --with-build-time-tools=/usr/gnu/sparc-sun-solaris2.11/bin --disable-libitm --without-gnu-as --with-as=/usr/bin/as LDFLAGS=-R/usr/gcc/6/lib Thread model: posix gcc version 6.5.0 (OpenIndiana 6.5.0-OI-4) Here's the error I get: <mills@t2000:946>$ /export/home/mills/Downloads/code/oi-userland/components/developer/gcc-6/build/sparcv7/./gcc/xgcc -B/export/home/mills/Downloads/code/oi-userland/components/developer/gcc-6/build/sparcv7/./gcc/ -S conftest.c conftest.c: In function 'main': conftest.c:2:1: internal compiler error: Segmentation Fault main () ^~~~ 0x631deb crash_signal /export/home/mills/Downloads/code/oi-userland/components/developer/gcc-6/gcc-6.5.0/gcc/toplev.c:333 0x360b3c et_splay /export/home/mills/Downloads/code/oi-userland/components/developer/gcc-6/gcc-6.5.0/gcc/et-forest.c:311 0x361833 et_set_father /export/home/mills/Downloads/code/oi-userland/components/developer/gcc-6/gcc-6.5.0/gcc/et-forest.c:525 0x301e6b calculate_dominance_info(cdi_direction) /export/home/mills/Downloads/code/oi-userland/components/developer/gcc-6/gcc-6.5.0/gcc/dominance.c:658 0x6701cb cleanup_tree_cfg_noloop /export/home/mills/Downloads/code/oi-userland/components/developer/gcc-6/gcc-6.5.0/gcc/tree-cfgcleanup.c:759 0x6701cb cleanup_tree_cfg() /export/home/mills/Downloads/code/oi-userland/components/developer/gcc-6/gcc-6.5.0/gcc/tree-cfgcleanup.c:818 0x66ab87 execute_build_cfg /export/home/mills/Downloads/code/oi-userland/components/developer/gcc-6/gcc-6.5.0/gcc/tree-cfg.c:360 0x66ab87 execute /export/home/mills/Downloads/code/oi-userland/components/developer/gcc-6/gcc-6.5.0/gcc/tree-cfg.c:389 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://bugs.openindiana.org> for instructions. Here's the source file: <mills@t2000:948>$ cat conftest.c int main () { ; return 0; } This happens on a Sun T2000 running v9os (oi_151a9). The kernel is illumos. I get the same error and backtrace with gcc-6.4.0 and gcc-7.3.0 . It worked with gcc-4.9.4 . The error appears with the configuration for phase 2 and also when xgcc is run separately as in this test. It does build correctly on x86 hardware. Note that all of these gcc versions have some patches applied. These patches adapt gcc for building the illumos kernel. I'm willing to test potential fixes on my hardware and OS or to gather additional debugging information.