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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Michael Meissner <meiss...@gcc.gnu.org>:

https://gcc.gnu.org/g:306c7b1ac3e4413288e6930b00a3cab2133c4e57

commit r13-6507-g306c7b1ac3e4413288e6930b00a3cab2133c4e57
Author: Michael Meissner <meiss...@linux.ibm.com>
Date:   Mon Mar 6 17:38:33 2023 -0500

    PR target/107299: Fix build issue when long double is IEEE 128-bit

    This patch updates the IEEE 128-bit types used in libgcc.

    At the moment, we cannot build GCC when the target uses IEEE 128-bit long
    doubles, such as building the compiler for a native Fedora 36 system.  The
    build dies when it is trying to build the _mulkc3.c and _divkc3 modules.

    This patch changes libgcc to use long double for the IEEE 128-bit base type
if
    long double is IEEE 128-bit, and it uses _Float128 otherwise.  The built-in
    functions are adjusted to be the correct version based on the IEEE 128-bit
base
    type used.

    While it is desirable to ultimately have __float128 and _Float128 use the
same
    internal type and mode within GCC, at present if you use the option
    -mabi=ieeelongdouble, the __float128 type will use the long double type and
not
    the _Float128 type.  We get an internal compiler error if we combine the
    signbitf128 built-in with a long double type.

    I've gone through several iterations of trying to fix this within GCC, and
    there are various problems that have come up.  I developed this alternative
    patch that changes libgcc so that it does not tickle the issue.  I hope we
can
    fix the compiler at some point, but right now, this is preventing people on
    Fedora 36 systems from building compilers where the default long double is
IEEE
    128-bit.

    2023-03-06   Michael Meissner  <meiss...@linux.ibm.com>

    libgcc/

            PR target/107299
            * config/rs6000/_divkc3.c (COPYSIGN): Use the correct built-in
based on
            whether long double is IBM or IEEE.
            (INFINITY): Likewise.
            (FABS): Likewise.
            * config/rs6000/_mulkc3.c (COPYSIGN): Likewise.
            (INFINITY): Likewise.
            * config/rs6000/quad-float128.h (TF): Remove definition.
            (TFtype): Define to be long double or _Float128.
            (TCtype): Define to be _Complex long double or _Complex _Float128.
            * libgcc2.h (TFtype): Allow machine config files to override this.
            (TCtype): Likewise.
            * soft-fp/quad.h (TFtype): Likewise.

Reply via email to