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

--- Comment #14 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Patrick McGehearty from comment #13)
> I may be mistaken about the source of the issue being glibc.
> Perhaps it is a system include file issue? Here are some
> more details.
> 
> Here are some of the error messages I got when building with
> __LIBGCC_KF_MAX__ of gcc135.fsffrance.org using the installed
> gcc (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC))
> 
> - - - - - -
> ../../../libgcc/config/rs6000/_divkc3.c: In function ‘__divkc3’:
> ../../../libgcc/config/rs6000/_divkc3.c:41:17: error: 
> ‘__LIBGCC_KF_MAX__’ undeclared (first use in this function)
>     41 | #define RBIG   (__LIBGCC_KF_MAX__ / 2)
>        |                 ^~~~~~~~~~~~~~~~~
> ../../../libgcc/config/rs6000/_divkc3.c:68:23: note: in expansion of 
> macro ‘RBIG’
>     68 |       if (FABS (d) >= RBIG)
>        |                       ^~~~
> ... repeated for ‘__LIBGCC_KF_EPSILON__ and __LIBGCC_KF_MIN__
> - - - - - -

This is defined be GCC itself.  But not in the configuration you built.
This requires VSX (currently).

The problem is in the _divkc3.c code.

> __LIBGCC_KF_MAX__ should have been defined in the file 
> gcc/c-family/c-cppbuiltin.c
> in the loop starting at line 1274:
>        /* Properties of floating-point modes for libgcc2.c.  */
>        opt_scalar_float_mode mode_iter;
>        FOR_EACH_MODE_IN_CLASS (mode_iter, MODE_FLOAT)
>          {
>            scalar_float_mode mode = mode_iter.require ();

The mode does not exist in this config.  The macro should not have been
defined.

> KF is not available with this particular compiler/glibc 
> combination.

KF is not available if you use -mno-vsx.  This is the default in most
configurations.

> I did some digging in the latest sources and could not find a specific file
> which defined KF, TF, IF, etc. I assume it exists and I just did not 
> look in the
> right places.

rs6000-modes.def .  You need TARGET_FLOAT128_TYPE set to be able to use it;
you normally get

  TARGET_FLOAT128_TYPE = TARGET_FLOAT128_ENABLE_TYPE && TARGET_VSX;

> In any case, it is moot since Joseph Myers stated that I should not 
> include the
> "if compiling for ibm doubledouble" code in _divkc3.c because _divkc3.c 
> is only
> used for ieee128 code. Since he is the one who guided me in my changes 
> to c-cppbuiltin.c,
> I assume he knows more than I on this topic.

Ah :-)  That is essential context.  I did not know you hadn't done this yet.

Reply via email to