Index: gcc/optabs.c
===================================================================
--- gcc/optabs.c	(revision 206437)
+++ gcc/optabs.c	(working copy)
@@ -6227,11 +6227,23 @@ void
 init_tree_optimization_optabs (tree optnode)
 {
   /* Quick exit if we have already computed optabs for this target.  */
+#if SWITCHABLE_TARGET
   if (TREE_OPTIMIZATION_BASE_OPTABS (optnode) == this_target_optabs)
     return;
+  TREE_OPTIMIZATION_BASE_OPTABS (optnode) = this_target_optabs;
+#else
+  if (TREE_OPTIMIZATION_BASE_OPTABS (optnode) == NULL)
+    {
+      TREE_OPTIMIZATION_BASE_OPTABS (optnode) = (struct target_optabs *)
+	ggc_alloc_atomic (sizeof (struct target_optabs));
+    }
+  else if (memcmp (TREE_OPTIMIZATION_BASE_OPTABS (optnode),
+		   this_target_optabs, sizeof (struct target_optabs)) == 0)
+    return;
+  *TREE_OPTIMIZATION_BASE_OPTABS (optnode) = *this_target_optabs;
+#endif
 
   /* Forget any previous information and set up for the current target.  */
-  TREE_OPTIMIZATION_BASE_OPTABS (optnode) = this_target_optabs;
   struct target_optabs *tmp_optabs = (struct target_optabs *)
     TREE_OPTIMIZATION_OPTABS (optnode);
   if (tmp_optabs)
