Hi Oleg!
I don't understand why this is being limited to SH3 and SH4 only?
Almost all SH4 systems out there have an FPU (unless special configurations
are used). So I'd say if switching to soft-fp, then for SH-anything, not
just SH3/SH4.
If it yields some improvements for some users, I'm all for it.
Yeah I just defaulted to SH3/SH4 conservatively because that's the only
hardware I have. (My main platform also happens to be one of these SH4
without an FPU, the SH4AL-DSP.)
Once this is tested/validated on simulator, I'll happily simplify the
patch to apply to all SH.
I think it would make sense to test it using sh-sim on SH2 big-endian and
little endian at least, as that doesn't have an FPU and hence would run
tests utilizing soft-fp.
After building the toolchain for --target=sh-elf, you can use this to run
the testsuite in the simulator:
make -k check RUNTESTFLAGS="--target_board=sh-sim\{-m2/-ml,-m2/-mb}"
(add make -j parameter according to you needs -- it will be slow)
Alright, it might take a little bit.
Building the combined tree of gcc/binutils/newlib masters (again
following [1]) gives me an ICE in libstdc++v3/src/libbacktrace,
irrespective of my libgcc change:
---
during RTL pass: final
elf.c: In function ‘elf_zstd_decompress’:
elf.c:4999:1: internal compiler error: in output_296, at
config/sh/sh.md:8408
4999 | }
| ^
0x1c8765e internal_error(char const*, ...)
../../combined/gcc/diagnostic-global-context.cc:491
0x881269 fancy_abort(char const*, int, char const*)
../../combined/gcc/diagnostic.cc:1725
0x83b73b output_296
../../combined/gcc/config/sh/sh.md:8408
0x83b73b output_296
../../combined/gcc/config/sh/sh.md:8063
0xb783c2 final_scan_insn_1
../../combined/gcc/final.cc:2773
0xb78938 final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
../../combined/gcc/final.cc:2886
0xb78b5f final_1
../../combined/gcc/final.cc:1977
0xb796a8 rest_of_handle_final
../../combined/gcc/final.cc:4239
0xb796a8 execute
../../combined/gcc/final.cc:4317
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make[9]: *** [Makefile:628: std_stacktrace-elf.lo] Error 1
make[9]: *** Waiting for unfinished jobs....
make[9]: Leaving directory
'/home/el/Programs/sh-elf-gcc/build-combined2/sh-elf/m2a/libstdc++-v3/src/libbacktrace'
---
My configure, for reference (--disable-source-highlight came up from a
configure error earlier):
../combined/configure \
--prefix="$PREFIX" \
--target="sh-elf" \
--enable-languages="c,c++" \
--disable-gdb \
--disable-source-highlight
The libbacktrace build in gcc (make all-libbacktrace) works without an
issue.
I'll have to prepare a bug report (I couldn't find anything related),
but bisecting on a triplet of repos doesn't sound very fun and I believe
I do need the newlib to build libstdc++ in a reproducible way.
Any advice before I go on that tangent?
Sébastien
[1] https://gcc.gnu.org/simtest-howto.html