[Bug libgcc/104984] New: Use hard-fp for libgcc single-floating-point routines

archicharmer at mail dot ru gcc-bugzilla@gcc.gnu.org
Sat Mar 19 05:36:54 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104984

            Bug ID: 104984
           Summary: Use hard-fp for libgcc single-floating-point routines
           Product: gcc
           Version: 9.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: archicharmer at mail dot ru
  Target Milestone: ---

I am currently using gcc-9.2.0 . At it's last building stage it was compiled
using the next configure additions:
--prefix=$PREFIX --enable-languages=c,c++ --includedir=$PREFIX/include
--target=mipsel-unknown-linux-gnu --with-arch=r6000 --with-float=hard
--with-fpu=single --enable-libatomic --with-llsc=yes --disable-multilib
--disable-libsanitizer
It generates the binaries of hard-float single-float ABI=o32 ISA=MIPS-II if
that matters.

I compiled the system from scratch by the cross-compiler which includes that
kind of gcc, and some of the programs - magick (ImageMagick), gdb, groupadd -
has the same segmentation fault in them:

$ gdb magick
$ run import scr.jpg
Program received signal SIGSEGV, Segmentation fault.
0x008c30e4 in __divdf3 (x=0, y=4) at ../../../libgcc/config/hardfp.c:37
37      ../../../libgcc/config/hardfp.c: No such file or directory.

I beleive it is someway related to this:
https://gcc.gnu.org/legacy-ml/gcc-patches/2014-02/msg00420.html

because if to make the next changes in the libgcc's config.host file:
        # All MIPS targets provide a full set of FP routines.
        cpu_type=mips
        tmake_file="mips/t-mips"
-       if test "${libgcc_cv_mips_hard_float}" = yes; then
-               tmake_file="${tmake_file} t-hardfp-sfdf t-hardfp"
-       else
+#      if test "${libgcc_cv_mips_hard_float}" = yes; then
+#              tmake_file="${tmake_file} t-hardfp-sfdf t-hardfp"
+#      else
                tmake_file="${tmake_file} t-softfp-sfdf"
-       fi
+#      fi

- those SegFaults disappears.

I have a mipsel system which have 32bit registers only and do not support
double floating point operations hardwarely (that's r5900). Can you make some
workarounds to such possible files like
libgcc/config/t-hardfp, libgcc/config/t-hardfp-sfdf and libgcc/config/hardfp.c
so it will be using only single-float libgcc functions for it's routines
hardwarely and the rest it will be using softwarely?


More information about the Gcc-bugs mailing list