Bug 87438 - ICE building gfortran for MicroBlaze target
Summary: ICE building gfortran for MicroBlaze target
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 8.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 103613 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-09-26 03:06 UTC by Zach van Rijn
Modified: 2021-12-08 07:15 UTC (History)
2 users (show)

See Also:
Host:
Target: microblaze-linux-musl
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Build log with -j1 for clarity. (222.10 KB, application/gzip)
2018-09-26 03:06 UTC, Zach van Rijn
Details
Test case. Triggers bug on 8.x to at least 10-20190721. (698 bytes, text/x-csrc)
2019-08-10 22:38 UTC, Zach van Rijn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zach van Rijn 2018-09-26 03:06:52 UTC
Created attachment 44752 [details]
Build log with -j1 for clarity.

Attempting to build GCC 8.2.0 with the following flags for the MicroBlaze target:

--enable-languages=c,c++,fortran --disable-libquadmath --disable-libquadmath-support --disable-decimal-float --disable-multilib

Results in the following ICE:

mv -f .deps/bessel_r4.Tpo .deps/bessel_r4.Plo
/bin/sh ./libtool  --tag=CC   --mode=compile /kale/musl-cross-make/build/local/microblaze-linux-musl/obj_gcc/./gcc/xgcc -B/kale/musl-cross-make/build/local/microblaze-linux-musl/obj_gcc/./gcc/ -B/microblaze-linux-musl/bin/ -B/microblaze-linux-musl/lib/ -isystem /microblaze-linux-musl/include -isystem /microblaze-linux-musl/sys-include --sysroot=/kale/musl-cross-make/build/local/microblaze-linux-musl/obj_sysroot -fdebug-prefix-map=/kale/musl-cross-make/build/local/microblaze-linux-musl=  -DHAVE_CONFIG_H -I. -I../../../src_gcc/libgfortran  -iquote../../../src_gcc/libgfortran/io -I../../../src_gcc/libgfortran/../gcc -I../../../src_gcc/libgfortran/../gcc/config  -I../.././gcc -I../../../src_gcc/libgfortran/../libgcc -I../libgcc -I../../../src_gcc/libgfortran/../libbacktrace -I../libbacktrace -I../libbacktrace  -std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings -Werror=implicit-function-declaration -Werror=vla  -fcx-fortran-rules -ffunction-sections -fdata-sections   -g -O2 -MT bessel_r8.lo -MD -MP -MF .deps/bessel_r8.Tpo -c -o bessel_r8.lo `test -f '../../../src_gcc/libgfortran/generated/bessel_r8.c' || echo '../../../src_gcc/libgfortran/'`../../../src_gcc/libgfortran/generated/bessel_r8.c
libtool: compile:  /kale/musl-cross-make/build/local/microblaze-linux-musl/obj_gcc/./gcc/xgcc -B/kale/musl-cross-make/build/local/microblaze-linux-musl/obj_gcc/./gcc/ -B/microblaze-linux-musl/bin/ -B/microblaze-linux-musl/lib/ -isystem /microblaze-linux-musl/include -isystem /microblaze-linux-musl/sys-include --sysroot=/kale/musl-cross-make/build/local/microblaze-linux-musl/obj_sysroot -fdebug-prefix-map=/kale/musl-cross-make/build/local/microblaze-linux-musl= -DHAVE_CONFIG_H -I. -I../../../src_gcc/libgfortran -iquote../../../src_gcc/libgfortran/io -I../../../src_gcc/libgfortran/../gcc -I../../../src_gcc/libgfortran/../gcc/config -I../.././gcc -I../../../src_gcc/libgfortran/../libgcc -I../libgcc -I../../../src_gcc/libgfortran/../libbacktrace -I../libbacktrace -I../libbacktrace -std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings -Werror=implicit-function-declaration -Werror=vla -fcx-fortran-rules -ffunction-sections -fdata-sections -g -O2 -MT bessel_r8.lo -MD -MP -MF .deps/bessel_r8.Tpo -c ../../../src_gcc/libgfortran/generated/bessel_r8.c  -fPIC -DPIC -o .libs/bessel_r8.o
during RTL pass: reload
../../../src_gcc/libgfortran/generated/bessel_r8.c: In function 'bessel_yn_r8':
../../../src_gcc/libgfortran/generated/bessel_r8.c:178:1: internal compiler error: in gen_reg_rtx, at emit-rtl.c:1155
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.

Host compiler flags:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-foxkit-linux-musl/6.4.0/lto-wrapper
Target: x86_64-foxkit-linux-musl
Configured with: /usr/src/packages/system/gcc/src/gcc-6.4.0/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --build=x86_64-foxkit-linux-musl --host=x86_64-foxkit-linux-musl --target=x86_64-foxkit-linux-musl --with-pkgversion='Adelie 6.4.0' --with-bugurl=http://bts.adelielinux.org/ --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-werror --disable-symvers --enable-__cxa_atexit --enable-default-pie --enable-cloog-backend --enable-languages=c,c++,objc,java,go,fortran --disable-libmpx --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads --enable-tls --with-system-zlib --with-linker-hash-style=gnu
Thread model: posix
gcc version 6.4.0 (Adelie 6.4.0)

Intermediate compiler flags:

$ ./xgcc -v
Using built-in specs.
COLLECT_GCC=./xgcc
Target: microblaze-linux-musl
Configured with: ../src_gcc/configure --enable-languages=c,c++ CC='gcc -static --static' CXX='g++ -static --static' FC='gfortran -static --static' CFLAGS='-g0 -Os' CXXFLAGS='-g0 -Os' FFLAGS='-g0 -Os' LDFLAGS='-s -static --static' --disable-nls MAKEINFO=/bin/false --with-debug-prefix-map=/kale/musl-cross-make/build/local/microblaze-linux-musl= --enable-languages=c,c++,fortran --disable-libquadmath --disable-libquadmath-support --disable-decimal-float --disable-multilib --disable-werror --target=microblaze-linux-musl --prefix= --libdir=/lib --disable-multilib --with-sysroot=/microblaze-linux-musl --enable-tls --disable-libmudflap --disable-libsanitizer --disable-gnu-indirect-function --disable-libmpx --enable-deterministic-archives --enable-libstdcxx-time --with-build-sysroot=/kale/musl-cross-make/build/local/microblaze-linux-musl/obj_sysroot AR_FOR_TARGET=/kale/musl-cross-make/build/local/microblaze-linux-musl/obj_binutils/binutils/ar AS_FOR_TARGET=/kale/musl-cross-make/build/local/microblaze-linux-musl/obj_binutils/gas/as-new LD_FOR_TARGET=/kale/musl-cross-make/build/local/microblaze-linux-musl/obj_binutils/ld/ld-new NM_FOR_TARGET=/kale/musl-cross-make/build/local/microblaze-linux-musl/obj_binutils/binutils/nm-new OBJCOPY_FOR_TARGET=/kale/musl-cross-make/build/local/microblaze-linux-musl/obj_binutils/binutils/objcopy OBJDUMP_FOR_TARGET=/kale/musl-cross-make/build/local/microblaze-linux-musl/obj_binutils/binutils/objdump RANLIB_FOR_TARGET=/kale/musl-cross-make/build/local/microblaze-linux-musl/obj_binutils/binutils/ranlib READELF_FOR_TARGET=/kale/musl-cross-make/build/local/microblaze-linux-musl/obj_binutils/binutils/readelf STRIP_FOR_TARGET=/kale/musl-cross-make/build/local/microblaze-linux-musl/obj_binutils/binutils/strip-new
Thread model: posix
gcc version 8.2.0 (GCC)

The full build log (-j1) is attached.
Comment 1 Zach van Rijn 2019-08-10 22:38:07 UTC
Created attachment 46699 [details]
Test case. Triggers bug on 8.x to at least 10-20190721.
Comment 2 Zach van Rijn 2019-08-10 22:40:03 UTC
Using GCC 8-20180706 snapshot,

gcc -c -O2 -fPIC grapes.c 
during RTL pass: reload
grapes.c: In function 'smaxval_r8':
grapes.c:57:1: internal compiler error: in gen_reg_rtx, at emit-rtl.c:1155
 }
 ^
0x408422 gen_reg_rtx(machine_mode)
	../../src_gcc/gcc/emit-rtl.c:1155
0x5e6ba6 force_reg(machine_mode, rtx_def*)
	../../src_gcc/gcc/explow.c:665
0xc25604 gen_movdf(rtx_def*, rtx_def*)
	../../src_gcc/gcc/config/microblaze/microblaze.md:1224
0x5fe6c5 insn_gen_fn::operator()(rtx_def*, rtx_def*) const
	../../src_gcc/gcc/recog.h:301
0x5fe6c5 emit_move_insn_1(rtx_def*, rtx_def*)
	../../src_gcc/gcc/expr.c:3666
0x603b45 gen_move_insn(rtx_def*, rtx_def*)
	../../src_gcc/gcc/expr.c:3782
0x80e858 gen_reload
	../../src_gcc/gcc/reload1.c:8740
0x8171a7 emit_input_reload_insns
	../../src_gcc/gcc/reload1.c:7632
0x8171a7 do_input_reload
	../../src_gcc/gcc/reload1.c:7919
0x8171a7 emit_reload_insns
	../../src_gcc/gcc/reload1.c:8107
0x8171a7 reload_as_needed
	../../src_gcc/gcc/reload1.c:4647
0x81ab76 reload(rtx_insn*, int)
	../../src_gcc/gcc/reload1.c:1050
0x7044ea do_reload
	../../src_gcc/gcc/ira.c:5477
0x7044ea execute
	../../src_gcc/gcc/ira.c:5649
Comment 3 Andrew Pinski 2021-12-08 07:15:44 UTC
*** Bug 103613 has been marked as a duplicate of this bug. ***