[nvptx] return true in libc_has_function for function_sincos
gcc/ChangeLog:
* config/nvptx/nvptx.c (nvptx_libc_has_function): New.
(TARGET_LIBC_HAS_FUNCTION): Redefine to new func.
@@ -6536,6 +6536,21 @@ nvptx_set_current_function (tree fndecl)
oacc_bcast_partition = 0;
}
+/* By default we assume that c99 functions are present at the runtime,
+ including sincos which is excluded in default_libc_has_function. */
+bool
+nvptx_libc_has_function (enum function_class fn_class)
+{
+ if (fn_class == function_c94
+ || fn_class == function_c99_misc
+ || fn_class == function_c99_math_complex
+ || fn_class == function_sincos)
+ return true;
+
+ return false;
+}
+
+
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE nvptx_option_override
@@ -6681,6 +6696,9 @@ nvptx_set_current_function (tree fndecl)
#undef TARGET_SET_CURRENT_FUNCTION
#define TARGET_SET_CURRENT_FUNCTION nvptx_set_current_function
+#undef TARGET_LIBC_HAS_FUNCTION
+#define TARGET_LIBC_HAS_FUNCTION nvptx_libc_has_function
+
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-nvptx.h"