PR libstdc++/84654 Disable __float128 specializations for -mno-float128
authorTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Tue, 1 May 2018 22:47:33 +0000 (22:47 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 1 May 2018 22:47:33 +0000 (23:47 +0100)
2018-05-01  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>

PR libstdc++/84654
* acinclude.m4: Set ENABLE_FLOAT128 instead of _GLIBCXX_USE_FLOAT128.
* config.h.in: Remove references to _GLIBCXX_USE_FLOAT128.
* configure: Regenerate.
* include/Makefile.am: Replace the value of _GLIBCXX_USE_FLOAT128
based on ENABLE_FLOAT128.
* include/Makefile.in: Regenerate.
* include/bits/c++config: Define _GLIBCXX_USE_FLOAT128.
[!defined(__FLOAT128__) && !defined(__SIZEOF_FLOAT128__)]: Undefine
_GLIBCXX_USE_FLOAT128.

From-SVN: r259813

libstdc++-v3/ChangeLog
libstdc++-v3/acinclude.m4
libstdc++-v3/config.h.in
libstdc++-v3/configure
libstdc++-v3/include/Makefile.am
libstdc++-v3/include/Makefile.in
libstdc++-v3/include/bits/c++config

index acdc6ffd124da472e36e471e8c3487a0d004b7a7..9ef88a8de9a3ddb871ef6d81e0cce629ed121dbb 100644 (file)
@@ -1,3 +1,16 @@
+2018-05-01  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
+
+       PR libstdc++/84654
+       * acinclude.m4: Set ENABLE_FLOAT128 instead of _GLIBCXX_USE_FLOAT128.
+       * config.h.in: Remove references to _GLIBCXX_USE_FLOAT128.
+       * configure: Regenerate.
+       * include/Makefile.am: Replace the value of _GLIBCXX_USE_FLOAT128
+       based on ENABLE_FLOAT128.
+       * include/Makefile.in: Regenerate.
+       * include/bits/c++config: Define _GLIBCXX_USE_FLOAT128.
+       [!defined(__FLOAT128__) && !defined(__SIZEOF_FLOAT128__)]: Undefine
+       _GLIBCXX_USE_FLOAT128.
+
 2018-04-24  H.J. Lu  <hongjiu.lu@intel.com>
 
        * configure: Regenerated.
index 3bd669a4cc8f5ca07347528b608882e43693a92e..4f37b6a6498471bac9b6d4ef1cec4d59367426d2 100644 (file)
@@ -3062,7 +3062,7 @@ dnl Note: also checks that the types aren't standard types.
 dnl
 dnl Defines:
 dnl  _GLIBCXX_USE_INT128
-dnl  _GLIBCXX_USE_FLOAT128
+dnl  ENABLE_FLOAT128
 dnl
 AC_DEFUN([GLIBCXX_ENABLE_INT128_FLOAT128], [
 
@@ -3117,13 +3117,12 @@ EOF
 
     AC_MSG_CHECKING([for __float128])
     if AC_TRY_EVAL(ac_compile); then
-      AC_DEFINE(_GLIBCXX_USE_FLOAT128, 1,
-      [Define if __float128 is supported on this host.])
       enable_float128=yes
     else
       enable_float128=no
     fi
     AC_MSG_RESULT($enable_float128)
+    GLIBCXX_CONDITIONAL(ENABLE_FLOAT128, test $enable_float128 = yes)
     rm -f conftest*
 
   AC_LANG_RESTORE
index 5a0f0678439ba4a8f2834d5f5aab8874e1f317d3..765cedc6edf93a9e95a18a4c280fac6e9be27829 100644 (file)
 /* Define if fchmodat is available in <sys/stat.h>. */
 #undef _GLIBCXX_USE_FCHMODAT
 
-/* Define if __float128 is supported on this host. */
-#undef _GLIBCXX_USE_FLOAT128
-
 /* Defined if gettimeofday is available. */
 #undef _GLIBCXX_USE_GETTIMEOFDAY
 
index ba094be6f15ba38a4959c74f9102a514123e571f..c9dbaa139d5a73769b20a65929ec67218d6d2f8a 100755 (executable)
@@ -729,6 +729,8 @@ BASIC_FILE_H
 CSTDIO_H
 SECTION_FLAGS
 WERROR
+ENABLE_FLOAT128_FALSE
+ENABLE_FLOAT128_TRUE
 thread_header
 glibcxx_PCHFLAGS
 GLIBCXX_BUILD_PCH_FALSE
@@ -11606,7 +11608,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11609 "configure"
+#line 11611 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11712,7 +11714,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11715 "configure"
+#line 11717 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -15398,7 +15400,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
   # Fake what AC_TRY_COMPILE does.
 
     cat > conftest.$ac_ext << EOF
-#line 15401 "configure"
+#line 15403 "configure"
 int main()
 {
   typedef bool atomic_type;
@@ -15433,7 +15435,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 15436 "configure"
+#line 15438 "configure"
 int main()
 {
   typedef short atomic_type;
@@ -15468,7 +15470,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 15471 "configure"
+#line 15473 "configure"
 int main()
 {
   // NB: _Atomic_word not necessarily int.
@@ -15504,7 +15506,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 15507 "configure"
+#line 15509 "configure"
 int main()
 {
   typedef long long atomic_type;
@@ -15585,7 +15587,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu
   # unnecessary for this test.
 
     cat > conftest.$ac_ext << EOF
-#line 15588 "configure"
+#line 15590 "configure"
 int main()
 {
   _Decimal32 d1;
@@ -15627,7 +15629,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
   # unnecessary for this test.
 
     cat > conftest.$ac_ext << EOF
-#line 15630 "configure"
+#line 15632 "configure"
 template<typename T1, typename T2>
   struct same
   { typedef T2 type; };
@@ -15661,7 +15663,7 @@ $as_echo "$enable_int128" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 15664 "configure"
+#line 15666 "configure"
 template<typename T1, typename T2>
   struct same
   { typedef T2 type; };
@@ -15683,15 +15685,13 @@ $as_echo_n "checking for __float128... " >&6; }
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-
-$as_echo "#define _GLIBCXX_USE_FLOAT128 1" >>confdefs.h
-
       enable_float128=yes
     else
       enable_float128=no
     fi
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float128" >&5
 $as_echo "$enable_float128" >&6; }
+
     rm -f conftest*
 
   ac_ext=c
@@ -81248,6 +81248,15 @@ else
 fi
 
 
+    if test $enable_float128 = yes; then
+  ENABLE_FLOAT128_TRUE=
+  ENABLE_FLOAT128_FALSE='#'
+else
+  ENABLE_FLOAT128_TRUE='#'
+  ENABLE_FLOAT128_FALSE=
+fi
+
+
     if test $enable_libstdcxx_allocator_flag = new; then
   ENABLE_ALLOCATOR_NEW_TRUE=
   ENABLE_ALLOCATOR_NEW_FALSE='#'
@@ -81791,6 +81800,10 @@ if test -z "${GLIBCXX_BUILD_PCH_TRUE}" && test -z "${GLIBCXX_BUILD_PCH_FALSE}";
   as_fn_error "conditional \"GLIBCXX_BUILD_PCH\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${ENABLE_FLOAT128_TRUE}" && test -z "${ENABLE_FLOAT128_FALSE}"; then
+  as_fn_error "conditional \"ENABLE_FLOAT128\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${ENABLE_ALLOCATOR_NEW_TRUE}" && test -z "${ENABLE_ALLOCATOR_NEW_FALSE}"; then
   as_fn_error "conditional \"ENABLE_ALLOCATOR_NEW\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
index 70a662fa2f9e01a7315f079008b9d6b8fea08dae..ba5adda95bd07f9f631e92bdafa59d746894d4b9 100644 (file)
@@ -1230,6 +1230,14 @@ stamp-allocator-new:
        echo 0 > stamp-allocator-new
 endif
 
+if ENABLE_FLOAT128
+stamp-float128:
+       echo 1 > stamp-float128
+else
+stamp-float128:
+       echo 0 > stamp-float128
+endif
+
 # NB: The non-empty default ldbl_compat works around an AIX sed
 # oddity, see libstdc++/31957 for details.
 ${host_builddir}/c++config.h: ${CONFIG_HEADER} \
@@ -1241,7 +1249,8 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \
                              stamp-extern-template \
                              stamp-dual-abi \
                              stamp-cxx11-abi \
-                             stamp-allocator-new
+                             stamp-allocator-new \
+                             stamp-float128
        @date=`cat ${toplevel_srcdir}/gcc/DATESTAMP` ;\
        release=`sed 's/^\([0-9]*\).*$$/\1/' ${toplevel_srcdir}/gcc/BASE-VER` ;\
        ns_version=`cat stamp-namespace-version` ;\
@@ -1250,6 +1259,7 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \
        dualabi=`cat stamp-dual-abi` ;\
        cxx11abi=`cat stamp-cxx11-abi` ;\
        allocatornew=`cat stamp-allocator-new` ;\
+       float128=`cat stamp-float128` ;\
        ldbl_compat='s,g,g,' ;\
        grep "^[         ]*#[    ]*define[       ][      ]*_GLIBCXX_LONG_DOUBLE_COMPAT[  ][      ]*1[    ]*$$" \
        ${CONFIG_HEADER} > /dev/null 2>&1 \
@@ -1262,6 +1272,7 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \
        -e "s,define _GLIBCXX_USE_DUAL_ABI, define _GLIBCXX_USE_DUAL_ABI $$dualabi," \
        -e "s,define _GLIBCXX_USE_CXX11_ABI, define _GLIBCXX_USE_CXX11_ABI $$cxx11abi," \
        -e "s,define _GLIBCXX_USE_ALLOCATOR_NEW, define _GLIBCXX_USE_ALLOCATOR_NEW $$allocatornew," \
+       -e "s,define _GLIBCXX_USE_FLOAT128, define _GLIBCXX_USE_FLOAT128 $$float128," \
        -e "$$ldbl_compat" \
            < ${glibcxx_srcdir}/include/bits/c++config > $@ ;\
        sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \
index 790887a259cef9ae4d4dd88d0ac5af7339dc29eb..41ccc7befe451c7fba87619c71a0efe5e70b4e7c 100644 (file)
@@ -1662,6 +1662,11 @@ stamp-host: ${host_headers} ${bits_host_headers} ${ext_host_headers} ${host_head
 @ENABLE_ALLOCATOR_NEW_FALSE@stamp-allocator-new:
 @ENABLE_ALLOCATOR_NEW_FALSE@   echo 0 > stamp-allocator-new
 
+@ENABLE_FLOAT128_TRUE@stamp-float128:
+@ENABLE_FLOAT128_TRUE@ echo 1 > stamp-float128
+@ENABLE_FLOAT128_FALSE@stamp-float128:
+@ENABLE_FLOAT128_FALSE@        echo 0 > stamp-float128
+
 # NB: The non-empty default ldbl_compat works around an AIX sed
 # oddity, see libstdc++/31957 for details.
 ${host_builddir}/c++config.h: ${CONFIG_HEADER} \
@@ -1673,7 +1678,8 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \
                              stamp-extern-template \
                              stamp-dual-abi \
                              stamp-cxx11-abi \
-                             stamp-allocator-new
+                             stamp-allocator-new \
+                             stamp-float128
        @date=`cat ${toplevel_srcdir}/gcc/DATESTAMP` ;\
        release=`sed 's/^\([0-9]*\).*$$/\1/' ${toplevel_srcdir}/gcc/BASE-VER` ;\
        ns_version=`cat stamp-namespace-version` ;\
@@ -1682,6 +1688,7 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \
        dualabi=`cat stamp-dual-abi` ;\
        cxx11abi=`cat stamp-cxx11-abi` ;\
        allocatornew=`cat stamp-allocator-new` ;\
+       float128=`cat stamp-float128` ;\
        ldbl_compat='s,g,g,' ;\
        grep "^[         ]*#[    ]*define[       ][      ]*_GLIBCXX_LONG_DOUBLE_COMPAT[  ][      ]*1[    ]*$$" \
        ${CONFIG_HEADER} > /dev/null 2>&1 \
@@ -1694,6 +1701,7 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \
        -e "s,define _GLIBCXX_USE_DUAL_ABI, define _GLIBCXX_USE_DUAL_ABI $$dualabi," \
        -e "s,define _GLIBCXX_USE_CXX11_ABI, define _GLIBCXX_USE_CXX11_ABI $$cxx11abi," \
        -e "s,define _GLIBCXX_USE_ALLOCATOR_NEW, define _GLIBCXX_USE_ALLOCATOR_NEW $$allocatornew," \
+       -e "s,define _GLIBCXX_USE_FLOAT128, define _GLIBCXX_USE_FLOAT128 $$float128," \
        -e "$$ldbl_compat" \
            < ${glibcxx_srcdir}/include/bits/c++config > $@ ;\
        sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \
index 1eb4679f67c419b30fb1b9bbf50e3423ea3d4320..e34524117d61ca2b554bf9fef83ea95f0df73f0b 100644 (file)
@@ -609,4 +609,10 @@ namespace std
 # endif
 #endif
 
+/* Define if __float128 is supported on this host. */
+#define _GLIBCXX_USE_FLOAT128
+#if !defined(__FLOAT128__) && !defined(__SIZEOF_FLOAT128__)
+#undef _GLIBCXX_USE_FLOAT128
+#endif
+
 // End of prewritten config; the settings discovered at configure time follow.