summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2014-09-23 01:48:46 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2014-09-23 01:48:46 +0100
commit9a79452d4cad6c34e9ff7c4370157bb1d6ad8869 (patch)
treeb856d45ce77cbdaa24295e19ce10446dab3f4dae /gcc
parent6c499348bcb15bc1697bb1d2c3acc257d4294457 (diff)
downloadgcc-9a79452d4cad6c34e9ff7c4370157bb1d6ad8869.tar.gz
Remove LIBGCC2_LONG_DOUBLE_TYPE_SIZE target macro.
This patch removes the target macro LIBGCC2_LONG_DOUBLE_TYPE_SIZE. After recent changes, this macro was used in two ways in libgcc: to determine the mode of long double in dfp-bit.h, and to determine whether a particular mode has excess precision for use in complex multiplication. The former is concerned specifically with long double: it relates to use of strtold for converting between decimal and binary floating point. This is replaced by comparing __LDBL_MANT_DIG__ with the appropriate __LIBGCC_*_MANT_DIG__ macro. The latter is replaced __LIBGCC_*_EXCESS_PRECISION__ predefined macros. Remarks: * Comparing (__LDBL_MANT_DIG__ == __LIBGCC_XF_MANT_DIG__) is more fragile than it looks; it's possible for XFmode to have 53-bit mantissa (TARGET_96_ROUND_53_LONG_DOUBLE, on FreeBSD and DragonFlyBSD 32-bit), in which case such a comparison would not distinguish XFmode and DFmode as possible modes for long double. Fortunately, no target supporting that form of XFmode also supports long double = double (but if some target did, we'd need e.g. an additional macro giving the exponent range of each mode). Furthermore, this code doesn't actually get used for x86 (or any other target with XFmode support), because x86 uses BID not DPD and BID has its own conversion code (which handles conversions for both XFmode and TFmode without needing to go via strtold). And FreeBSD and DragonFlyBSD aren't among the targets with DFP support. So while in principle this code is fragile and it's a deficiency that it can't support both XFmode and TFmode at once (something that can't be solved with the string conversion approach without libc having TS 18661 functions such as strtof128), all these issues should not be a problem in practice. * If other cases of excess precision are supported in future, the code for defining __LIBGCC_*_EXCESS_PRECISION__ may need updating. Although the most likely such cases might not actually involve excess precision for any mode used in libgcc - FLT_EVAL_METHOD being 32 to do _Float16 arithmetic on _Float32 should have the effect of _Complex _Float16 arithmetic using __mulsc3 and __divsc3, rather than currently nonexistent __mulhc3 and __divhc3 as in bug 63250 for ARM. * As has been noted in the context of simultaneous support for __float128 and __ibm128 on Power, the semantics of macros such as LONG_DOUBLE_TYPE_SIZE are problematic because they rely on a poorly-defined precision value for floating-point modes (which seems to be intended as the number of significant bits in the representation, e.g. 80 for XFmode which may be either 12 or 16 bytes) uniquely identifying a mode (although defining an arbitrarily different value for one of the modes you wish to distinguish may work as a hack). It would be cleaner to have a target hook that gives a machine mode directly for float, double and long double, rather than going via these precision values. By eliminating all use of these macros (FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, LONG_DOUBLE_TYPE_SIZE) from code built for the target, this patch facilitates such a conversion to a hook (which I suppose would take some suitable enum as an argument to identify which of the three types to return a mode for). (The issue of multiple type support for DFP conversions would apply in that Power case. <https://gcc.gnu.org/ml/gcc-patches/2014-07/msg01084.html> doesn't seem to touch on it, but it would seem reasonable to punt on it initially as hard to fix. There would also be the issue of getting functions such as __powikf2, __mulkc3, __divkc3 defined, but that's rather easier to address.) Bootstrapped with no regressions on x86_64-unknown-linux-gnu. gcc: * doc/tm.texi.in (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. * doc/tm.texi: Regenerate. * system.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Poison. * config/alpha/alpha.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. * config/i386/i386-interix.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. * config/i386/i386.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. * config/i386/rtemself.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. * config/ia64/ia64.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. * config/m68k/m68k.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. * config/m68k/netbsd-elf.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. * config/mips/mips.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. * config/mips/n32-elf.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. * config/msp430/msp430.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. * config/rl78/rl78.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. * config/rs6000/rs6000.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. * config/rx/rx.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. * config/s390/s390.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. * config/sparc/freebsd.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. * config/sparc/linux.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. * config/sparc/linux64.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. * config/sparc/netbsd-elf.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. gcc/c-family: * c-cppbuiltin.c (c_cpp_builtins): Define __LIBGCC_*_EXCESS_PRECISION__ macros for supported floating-point modes. libgcc: * dfp-bit.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. (__LIBGCC_XF_MANT_DIG__): Define if not already defined. (LONG_DOUBLE_HAS_XF_MODE): Define in terms of __LIBGCC_XF_MANT_DIG__. (__LIBGCC_TF_MANT_DIG__): Define if not already defined. (LONG_DOUBLE_HAS_TF_MODE): Define in terms of __LIBGCC_TF_MANT_DIG__. * libgcc2.c (NOTRUNC): Define in terms of __LIBGCC_*_EXCESS_PRECISION__, not LIBGCC2_LONG_DOUBLE_TYPE_SIZE. * libgcc2.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove. From-SVN: r215491
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog27
-rw-r--r--gcc/c-family/ChangeLog6
-rw-r--r--gcc/c-family/c-cppbuiltin.c24
-rw-r--r--gcc/config/alpha/alpha.h8
-rw-r--r--gcc/config/i386/i386-interix.h2
-rw-r--r--gcc/config/i386/i386.h10
-rw-r--r--gcc/config/i386/rtemself.h7
-rw-r--r--gcc/config/ia64/ia64.h4
-rw-r--r--gcc/config/m68k/m68k.h8
-rw-r--r--gcc/config/m68k/netbsd-elf.h7
-rw-r--r--gcc/config/mips/mips.h9
-rw-r--r--gcc/config/mips/n32-elf.h5
-rw-r--r--gcc/config/msp430/msp430.h2
-rw-r--r--gcc/config/rl78/rl78.h2
-rw-r--r--gcc/config/rs6000/rs6000.h8
-rw-r--r--gcc/config/rx/rx.h6
-rw-r--r--gcc/config/s390/s390.h8
-rw-r--r--gcc/config/sparc/freebsd.h8
-rw-r--r--gcc/config/sparc/linux.h8
-rw-r--r--gcc/config/sparc/linux64.h8
-rw-r--r--gcc/config/sparc/netbsd-elf.h12
-rw-r--r--gcc/doc/tm.texi7
-rw-r--r--gcc/doc/tm.texi.in7
-rw-r--r--gcc/system.h3
24 files changed, 59 insertions, 137 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 96a5d7a66e4..f91e231f2e6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,30 @@
+2014-09-22 Joseph Myers <joseph@codesourcery.com>
+
+ * doc/tm.texi.in (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
+ * doc/tm.texi: Regenerate.
+ * system.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Poison.
+ * config/alpha/alpha.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
+ * config/i386/i386-interix.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE):
+ Remove.
+ * config/i386/i386.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
+ * config/i386/rtemself.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
+ * config/ia64/ia64.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
+ * config/m68k/m68k.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
+ * config/m68k/netbsd-elf.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE):
+ Remove.
+ * config/mips/mips.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
+ * config/mips/n32-elf.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
+ * config/msp430/msp430.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
+ * config/rl78/rl78.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
+ * config/rs6000/rs6000.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
+ * config/rx/rx.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
+ * config/s390/s390.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
+ * config/sparc/freebsd.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
+ * config/sparc/linux.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
+ * config/sparc/linux64.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
+ * config/sparc/netbsd-elf.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE):
+ Remove.
+
2014-09-22 Jan Hubicka <hubicka@ucw.cz>
* tree-ssa-ccp.c (prop_value_d): Rename to ...
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index efe74173f17..468c78bfa26 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2014-09-22 Joseph Myers <joseph@codesourcery.com>
+
+ * c-cppbuiltin.c (c_cpp_builtins): Define
+ __LIBGCC_*_EXCESS_PRECISION__ macros for supported floating-point
+ modes.
+
2014-09-18 Joseph Myers <joseph@codesourcery.com>
* c-cppbuiltin.c (c_cpp_builtins): Define __LIBGCC_*_FUNC_EXT__
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index 9e2040b67d5..6748db435ed 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -978,6 +978,30 @@ c_cpp_builtins (cpp_reader *pfile)
else
gcc_unreachable ();
builtin_define_with_value (macro_name, suffix, 0);
+ bool excess_precision = false;
+ if (TARGET_FLT_EVAL_METHOD != 0
+ && mode != TYPE_MODE (long_double_type_node)
+ && (mode == TYPE_MODE (float_type_node)
+ || mode == TYPE_MODE (double_type_node)))
+ switch (TARGET_FLT_EVAL_METHOD)
+ {
+ case -1:
+ case 2:
+ excess_precision = true;
+ break;
+
+ case 1:
+ excess_precision = mode == TYPE_MODE (float_type_node);
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+ macro_name = (char *) alloca (strlen (name)
+ + sizeof ("__LIBGCC__EXCESS_"
+ "PRECISION__"));
+ sprintf (macro_name, "__LIBGCC_%s_EXCESS_PRECISION__", name);
+ builtin_define_with_int_value (macro_name, excess_precision);
}
/* For libgcc crtstuff.c and libgcc2.c. */
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index 88816f3148c..ea5fd13af19 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -203,14 +203,6 @@ extern enum alpha_fp_trap_mode alpha_fptm;
#define DOUBLE_TYPE_SIZE 64
#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64)
-/* Define this to set long double type size to use in libgcc2.c, which can
- not depend on target_flags. */
-#ifdef __LONG_DOUBLE_128__
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
-#else
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
-#endif
-
/* Work around target_flags dependency in ada/targtyps.c. */
#define WIDEST_HARDWARE_FP_SIZE 64
diff --git a/gcc/config/i386/i386-interix.h b/gcc/config/i386/i386-interix.h
index 49aef842f76..98b8ae14660 100644
--- a/gcc/config/i386/i386-interix.h
+++ b/gcc/config/i386/i386-interix.h
@@ -140,8 +140,6 @@ do { \
/* Turn off long double being 96 bits. */
#undef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE 64
-#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
#define IX86_NO_LIBGCC_TFMODE
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 2c641628d74..63005460783 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -694,16 +694,6 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
#define LONG_DOUBLE_TYPE_SIZE \
(TARGET_LONG_DOUBLE_64 ? 64 : (TARGET_LONG_DOUBLE_128 ? 128 : 80))
-/* Define this to set long double type size to use in libgcc2.c, which can
- not depend on target_flags. */
-#ifdef __LONG_DOUBLE_64__
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
-#elif defined (__LONG_DOUBLE_128__)
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
-#else
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 80
-#endif
-
#define WIDEST_HARDWARE_FP_SIZE 80
#if defined (TARGET_BI_ARCH) || TARGET_64BIT_DEFAULT
diff --git a/gcc/config/i386/rtemself.h b/gcc/config/i386/rtemself.h
index ce6d762948d..1461a9e9c4d 100644
--- a/gcc/config/i386/rtemself.h
+++ b/gcc/config/i386/rtemself.h
@@ -32,11 +32,4 @@ along with GCC; see the file COPYING3. If not see
#undef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE (TARGET_80387 ? 80 : 64)
-#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
-#ifdef _SOFT_FLOAT
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
-#else
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 80
-#endif
-
#define IX86_NO_LIBGCC_TFMODE
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index 4cc80a9c8ea..372bee740a7 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -253,10 +253,6 @@ while (0)
: TARGET_ABI_OPEN_VMS ? 64 \
: 80)
-/* We always want the XFmode operations from libgcc2.c, except on VMS
- where this yields references to unimplemented "insns". */
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE (TARGET_ABI_OPEN_VMS ? 64 : 80)
-
#define DEFAULT_SIGNED_CHAR 1
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index 5a6ceb50300..a621b627a39 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -280,14 +280,6 @@ along with GCC; see the file COPYING3. If not see
#define LONG_DOUBLE_TYPE_SIZE \
((TARGET_COLDFIRE || TARGET_FIDOA) ? 64 : 80)
-/* We need to know the size of long double at compile-time in libgcc2. */
-
-#if defined(__mcoldfire__) || defined(__mfido__)
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
-#else
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 80
-#endif
-
/* Set the value of FLT_EVAL_METHOD in float.h. When using 68040 fp
instructions, we get proper intermediate rounding, otherwise we
get extended precision results. */
diff --git a/gcc/config/m68k/netbsd-elf.h b/gcc/config/m68k/netbsd-elf.h
index be891933841..eade5b41921 100644
--- a/gcc/config/m68k/netbsd-elf.h
+++ b/gcc/config/m68k/netbsd-elf.h
@@ -39,13 +39,6 @@ along with GCC; see the file COPYING3. If not see
#undef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE (TARGET_68020 ? 80 : 64)
-#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
-#ifdef __mc68010__
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
-#else
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 80
-#endif
-
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
{ "netbsd_entry_point", NETBSD_ENTRY_POINT },
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 9a15287cdb1..c7b998bf758 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -1399,15 +1399,6 @@ struct mips_cpu_info {
support long double, we also want a 128-bit integer type. */
#define MAX_FIXED_MODE_SIZE LONG_DOUBLE_TYPE_SIZE
-#ifdef IN_LIBGCC2
-#if ((defined _ABIN32 && _MIPS_SIM == _ABIN32) \
- || (defined _ABI64 && _MIPS_SIM == _ABI64))
-# define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
-# else
-# define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
-# endif
-#endif
-
/* Width in bits of a pointer. */
#ifndef POINTER_SIZE
#define POINTER_SIZE ((TARGET_LONG64 && TARGET_64BIT) ? 64 : 32)
diff --git a/gcc/config/mips/n32-elf.h b/gcc/config/mips/n32-elf.h
index cb0cbbf9560..a611a9e404a 100644
--- a/gcc/config/mips/n32-elf.h
+++ b/gcc/config/mips/n32-elf.h
@@ -28,8 +28,3 @@ along with GCC; see the file COPYING3. If not see
/* Force n32 to use 64-bit long doubles. */
#undef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE 64
-
-#ifdef IN_LIBGCC2
-#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
-#endif
diff --git a/gcc/config/msp430/msp430.h b/gcc/config/msp430/msp430.h
index 068bdada814..70196e2e7d9 100644
--- a/gcc/config/msp430/msp430.h
+++ b/gcc/config/msp430/msp430.h
@@ -111,8 +111,6 @@ extern bool msp430x;
#define DOUBLE_TYPE_SIZE 64
#define LONG_DOUBLE_TYPE_SIZE 64 /*DOUBLE_TYPE_SIZE*/
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
-
#define DEFAULT_SIGNED_CHAR 0
#define STRICT_ALIGNMENT 1
diff --git a/gcc/config/rl78/rl78.h b/gcc/config/rl78/rl78.h
index 947c4084661..c3cae69275a 100644
--- a/gcc/config/rl78/rl78.h
+++ b/gcc/config/rl78/rl78.h
@@ -98,8 +98,6 @@
#define DOUBLE_TYPE_SIZE 32 /*64*/
#define LONG_DOUBLE_TYPE_SIZE 64 /*DOUBLE_TYPE_SIZE*/
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
-
#define DEFAULT_SIGNED_CHAR 0
#define STRICT_ALIGNMENT 1
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 8a0fcab63f8..1fd4f2aa021 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -820,14 +820,6 @@ extern unsigned char rs6000_recip_bits[];
words. */
#define LONG_DOUBLE_TYPE_SIZE rs6000_long_double_type_size
-/* Define this to set long double type size to use in libgcc2.c, which can
- not depend on target_flags. */
-#ifdef __LONG_DOUBLE_128__
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
-#else
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
-#endif
-
/* Work around rs6000_long_double_type_size dependency in ada/targtyps.c. */
#define WIDEST_HARDWARE_FP_SIZE 64
diff --git a/gcc/config/rx/rx.h b/gcc/config/rx/rx.h
index 2a008f7aa53..57a24e6dd20 100644
--- a/gcc/config/rx/rx.h
+++ b/gcc/config/rx/rx.h
@@ -130,12 +130,6 @@
#define DOUBLE_TYPE_SIZE (TARGET_64BIT_DOUBLES ? 64 : 32)
#define LONG_DOUBLE_TYPE_SIZE DOUBLE_TYPE_SIZE
-#ifdef __RX_32BIT_DOUBLES__
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 32
-#else
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
-#endif
-
#define DEFAULT_SIGNED_CHAR 0
/* RX load/store instructions can handle unaligned addresses. */
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index 2f2139e919b..c5edace139b 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -252,14 +252,6 @@ enum processor_flags
#define DOUBLE_TYPE_SIZE 64
#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64)
-/* Define this to set long double type size to use in libgcc2.c, which can
- not depend on target_flags. */
-#ifdef __LONG_DOUBLE_128__
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
-#else
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
-#endif
-
/* Work around target_flags dependency in ada/targtyps.c. */
#define WIDEST_HARDWARE_FP_SIZE 64
diff --git a/gcc/config/sparc/freebsd.h b/gcc/config/sparc/freebsd.h
index 371312bb4df..d89f11491f5 100644
--- a/gcc/config/sparc/freebsd.h
+++ b/gcc/config/sparc/freebsd.h
@@ -71,14 +71,6 @@ along with GCC; see the file COPYING3. If not see
#undef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64)
-/* Define this to set long double type size to use in libgcc2.c, which can
- not depend on target_flags. */
-#if defined(__arch64__) || defined(__LONG_DOUBLE_128__)
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
-#else
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
-#endif
-
/* Definitions for 64-bit SPARC running systems with ELF. */
#define TARGET_ELF 1
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index c54ba2cb51c..277e49a5f49 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -122,14 +122,6 @@ do { \
SPARC ABI says that long double is 4 words. */
#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64)
-/* Define this to set long double type size to use in libgcc2.c, which can
- not depend on target_flags. */
-#ifdef __LONG_DOUBLE_128__
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
-#else
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
-#endif
-
#undef DITF_CONVERSION_LIBFUNCS
#define DITF_CONVERSION_LIBFUNCS 1
diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
index f00fb42ffab..7f1288126c0 100644
--- a/gcc/config/sparc/linux64.h
+++ b/gcc/config/sparc/linux64.h
@@ -70,14 +70,6 @@ along with GCC; see the file COPYING3. If not see
#undef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64)
-/* Define this to set long double type size to use in libgcc2.c, which can
- not depend on target_flags. */
-#if defined(__arch64__) || defined(__LONG_DOUBLE_128__)
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
-#else
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
-#endif
-
#undef CPP_SUBTARGET_SPEC
#define CPP_SUBTARGET_SPEC "\
%{posix:-D_POSIX_SOURCE} \
diff --git a/gcc/config/sparc/netbsd-elf.h b/gcc/config/sparc/netbsd-elf.h
index 949d333f67c..5c74464269c 100644
--- a/gcc/config/sparc/netbsd-elf.h
+++ b/gcc/config/sparc/netbsd-elf.h
@@ -168,12 +168,6 @@ along with GCC; see the file COPYING3. If not see
#undef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64)
-#if defined(__arch64__) || defined(__LONG_DOUBLE_128__)
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
-#else
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
-#endif
-
#undef CC1_SPEC
#if DEFAULT_ARCH32_P
#define CC1_SPEC CC1_SPEC32
@@ -195,9 +189,6 @@ along with GCC; see the file COPYING3. If not see
#undef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE 128
-#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
-
#undef CC1_SPEC
#define CC1_SPEC CC1_SPEC64
@@ -210,9 +201,6 @@ along with GCC; see the file COPYING3. If not see
#undef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE 64
-#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
-
#undef CC1_SPEC
#define CC1_SPEC CC1_SPEC32
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 396909f2619..10af50e1b8b 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -1542,13 +1542,6 @@ the target machine. If you don't define this, the default is
@code{BITS_PER_UNIT * 16}.
@end defmac
-@defmac LIBGCC2_LONG_DOUBLE_TYPE_SIZE
-Define this macro if @code{LONG_DOUBLE_TYPE_SIZE} is not constant or
-if you want routines in @file{libgcc2.a} for a size other than
-@code{LONG_DOUBLE_TYPE_SIZE}. If you don't define this, the
-default is @code{LONG_DOUBLE_TYPE_SIZE}.
-@end defmac
-
@defmac LIBGCC2_GNU_PREFIX
This macro corresponds to the @code{TARGET_LIBFUNC_GNU_PREFIX} target
hook and should be defined if that hook is overriden to be true. It
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index 798c1aad5e2..f6f241b5093 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -1384,13 +1384,6 @@ the target machine. If you don't define this, the default is
@code{BITS_PER_UNIT * 16}.
@end defmac
-@defmac LIBGCC2_LONG_DOUBLE_TYPE_SIZE
-Define this macro if @code{LONG_DOUBLE_TYPE_SIZE} is not constant or
-if you want routines in @file{libgcc2.a} for a size other than
-@code{LONG_DOUBLE_TYPE_SIZE}. If you don't define this, the
-default is @code{LONG_DOUBLE_TYPE_SIZE}.
-@end defmac
-
@defmac LIBGCC2_GNU_PREFIX
This macro corresponds to the @code{TARGET_LIBFUNC_GNU_PREFIX} target
hook and should be defined if that hook is overriden to be true. It
diff --git a/gcc/system.h b/gcc/system.h
index 3208a9d6f8c..dbe1ceb3d8a 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -936,7 +936,8 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
EXTRA_CONSTRAINT_STR EXTRA_MEMORY_CONSTRAINT \
EXTRA_ADDRESS_CONSTRAINT CONST_DOUBLE_OK_FOR_CONSTRAINT_P \
CALLER_SAVE_PROFITABLE LARGEST_EXPONENT_IS_NORMAL \
- ROUND_TOWARDS_ZERO SF_SIZE DF_SIZE XF_SIZE TF_SIZE LIBGCC2_TF_CEXT
+ ROUND_TOWARDS_ZERO SF_SIZE DF_SIZE XF_SIZE TF_SIZE LIBGCC2_TF_CEXT \
+ LIBGCC2_LONG_DOUBLE_TYPE_SIZE
/* Hooks that are no longer used. */
#pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \