===================================================================
@@ -5069,7 +5069,6 @@ extern bool merge_ranges (int *, tree *,
extern void set_builtin_user_assembler_name (tree decl, const char *asmspec);
extern bool is_simple_builtin (tree);
extern bool is_inexpensive_builtin (tree);
-extern bool mode_has_fma (enum machine_mode mode);
/* In convert.c */
extern tree strip_float_extensions (tree);
===================================================================
@@ -13909,11 +13909,3 @@ is_inexpensive_builtin (tree decl)
return false;
}
-
-/* Return true if MODE provides a fast multiply/add (FMA) builtin function. */
-
-bool
-mode_has_fma (enum machine_mode mode)
-{
- return optab_handler (fma_optab, mode) != CODE_FOR_nothing;
-}
===================================================================
@@ -65,6 +65,43 @@ static void builtin_define_float_constan
const char *,
tree);
+/* Return true if MODE provides a fast multiply/add (FMA) builtin function.
+ Originally this function used the fma optab, but that doesn't work with
+ -save-temps, so just rely on the HAVE_fma macros for the stnadard floating
+ point types. */
+
+static bool
+mode_has_fma (enum machine_mode mode)
+{
+ switch (mode)
+ {
+#ifdef HAVE_fmasf4
+ case SFmode:
+ return !!HAVE_fmasf4;
+#endif
+
+#ifdef HAVE_fmadf4
+ case DFmode:
+ return !!HAVE_fmadf4;
+#endif
+
+#ifdef HAVE_fmaxf4
+ case XFmode:
+ return !!HAVE_fmaxf4;
+#endif
+
+#ifdef HAVE_fmatf4
+ case TFmode:
+ return !!HAVE_fmatf4;
+#endif
+
+ default:
+ break;
+ }
+
+ return false;
+}
+
/* Define NAME with value TYPE size_unit. */
static void
builtin_define_type_sizeof (const char *name, tree type)