aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid Edelsohn <dje.gcc@gmail.com>2020-04-30 11:29:32 -0400
committerDavid Edelsohn <dje.gcc@gmail.com>2020-05-04 17:10:00 -0400
commit5e681acd3587285cc3c8c6d603e4ce93cf6dacf2 (patch)
treee51dcf55002fba9841143eae20873f46b7aaab45 /gcc
parent3af3bec2e4d344bd54a134d8b2263f44d788c3d8 (diff)
downloadgcc-5e681acd3587285cc3c8c6d603e4ce93cf6dacf2.zip
gcc-5e681acd3587285cc3c8c6d603e4ce93cf6dacf2.tar.gz
gcc-5e681acd3587285cc3c8c6d603e4ce93cf6dacf2.tar.bz2
rs6000: AIX long double builtins for 64 bit long double.
When long doubles are 64 bit, the AIX C library overrides the definitions but GCC builtins point to 128 bit names. This patch overrides the builtins for fmodl, frexpl, ldexpl and modfl to refer to the 64 bit symbols. 2020-05-04 Clement Chigot <clement.chigot@atos.net> David Edelsohn <dje.gcc@gmail.com> * config/rs6000/rs6000-call.c (rs6000_init_builtins): Override explicit for fmodl, frexpl, ldexpl and modfl builtins.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/rs6000/rs6000-call.c26
2 files changed, 28 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c22e155..b534c55 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2020-05-04 Clement Chigot <clement.chigot@atos.net>
+ David Edelsohn <dje.gcc@gmail.com>
+
+ * config/rs6000/rs6000-call.c (rs6000_init_builtins): Override explicit
+ for fmodl, frexpl, ldexpl and modfl builtins.
+
2020-05-04 Richard Sandiford <richard.sandiford@arm.com>
PR middle-end/94941
diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index 7621d6f..68164b9 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -12070,10 +12070,28 @@ rs6000_init_builtins (void)
def_builtin ("__builtin_cpu_is", ftype, RS6000_BUILTIN_CPU_IS);
def_builtin ("__builtin_cpu_supports", ftype, RS6000_BUILTIN_CPU_SUPPORTS);
- /* AIX libm provides clog as __clog. */
- if (TARGET_XCOFF &&
- (tdecl = builtin_decl_explicit (BUILT_IN_CLOG)) != NULL_TREE)
- set_user_assembler_name (tdecl, "__clog");
+ if (TARGET_XCOFF)
+ {
+ /* AIX libm provides clog as __clog. */
+ if ((tdecl = builtin_decl_explicit (BUILT_IN_CLOG)) != NULL_TREE)
+ set_user_assembler_name (tdecl, "__clog");
+
+ /* When long double is 64 bit, some long double builtins of libc
+ functions (like __builtin_frexpl) must call the double version
+ (frexp) not the long double version (frexpl) that expects a 128 bit
+ argument. */
+ if (! TARGET_LONG_DOUBLE_128)
+ {
+ if ((tdecl = builtin_decl_explicit (BUILT_IN_FMODL)) != NULL_TREE)
+ set_user_assembler_name (tdecl, "fmod");
+ if ((tdecl = builtin_decl_explicit (BUILT_IN_FREXPL)) != NULL_TREE)
+ set_user_assembler_name (tdecl, "frexp");
+ if ((tdecl = builtin_decl_explicit (BUILT_IN_LDEXPL)) != NULL_TREE)
+ set_user_assembler_name (tdecl, "ldexp");
+ if ((tdecl = builtin_decl_explicit (BUILT_IN_MODFL)) != NULL_TREE)
+ set_user_assembler_name (tdecl, "modf");
+ }
+ }
#ifdef SUBTARGET_INIT_BUILTINS
SUBTARGET_INIT_BUILTINS;