summaryrefslogtreecommitdiff
path: root/gcc/config/darwin.c
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-07 20:41:50 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-07 20:41:50 +0000
commitf68291965a274ffe9d79d3c513caf947e40e621d (patch)
tree64b9e1e54766da31a2f1890d359a6c3a67297b5c /gcc/config/darwin.c
parent029247e87e5ab23d65fbb3bf875569148d38e811 (diff)
downloadgcc-f68291965a274ffe9d79d3c513caf947e40e621d.tar.gz
PR target/47558
Add __ieee_divdc3 entry point. * config/i386/darwin.h (DECLARE_LIBRARY_RENAMES): Retain ___divdc3 entry point. (SUBTARGET_INIT_BUILTINS): Call darwin_rename_builtins. * config/i386/i386.c (TARGET_INIT_LIBFUNCS): Likewise. * config/darwin.c (darwin_rename_builtins): Add. * config/darwin-protos.h (darwin_rename_builtins): Add. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169902 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/darwin.c')
-rw-r--r--gcc/config/darwin.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index cd6a815a483..8ccf18c4426 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -2823,6 +2823,34 @@ darwin_fold_builtin (tree fndecl, int n_args, tree *argp,
return NULL_TREE;
}
+void
+darwin_rename_builtins (void)
+{
+ /* The system ___divdc3 routine in libSystem on darwin10 is not
+ accurate to 1ulp, ours is, so we avoid ever using the system name
+ for this routine and instead install a non-conflicting name that
+ is accurate.
+
+ When -ffast-math or -funsafe-math-optimizations is given, we can
+ use the faster version. */
+ if (!flag_unsafe_math_optimizations)
+ {
+ int dcode = (BUILT_IN_COMPLEX_DIV_MIN
+ + DCmode - MIN_MODE_COMPLEX_FLOAT);
+ tree fn = built_in_decls[dcode];
+ /* Fortran and c call TARGET_INIT_BUILTINS and
+ TARGET_INIT_LIBFUNCS at different times, so we have to put a
+ call into each to ensure that at least one of them is called
+ after build_common_builtin_nodes. A better fix is to add a
+ new hook to run after build_common_builtin_nodes runs. */
+ if (fn)
+ set_user_assembler_name (fn, "___ieee_divdc3");
+ fn = implicit_built_in_decls[dcode];
+ if (fn)
+ set_user_assembler_name (fn, "___ieee_divdc3");
+ }
+}
+
static hashval_t
cfstring_hash (const void *ptr)
{