OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / tree-complex.c
index ec2b438..c45ba19 100644 (file)
@@ -956,7 +956,7 @@ expand_complex_libcall (gimple_stmt_iterator *gsi, tree ar, tree ai,
             (BUILT_IN_COMPLEX_DIV_MIN + mode - MIN_MODE_COMPLEX_FLOAT));
   else
     gcc_unreachable ();
-  fn = built_in_decls[bcode];
+  fn = builtin_decl_explicit (bcode);
 
   stmt = gimple_build_call (fn, 4, ar, ai, br, bi);
   gimple_call_set_lhs (stmt, lhs);
@@ -1400,6 +1400,36 @@ expand_complex_comparison (gimple_stmt_iterator *gsi, tree ar, tree ai,
   update_stmt (stmt);
 }
 
+/* Expand inline asm that sets some complex SSA_NAMEs.  */
+
+static void
+expand_complex_asm (gimple_stmt_iterator *gsi)
+{
+  gimple stmt = gsi_stmt (*gsi);
+  unsigned int i;
+
+  for (i = 0; i < gimple_asm_noutputs (stmt); ++i)
+    {
+      tree link = gimple_asm_output_op (stmt, i);
+      tree op = TREE_VALUE (link);
+      if (TREE_CODE (op) == SSA_NAME
+         && TREE_CODE (TREE_TYPE (op)) == COMPLEX_TYPE)
+       {
+         tree type = TREE_TYPE (op);
+         tree inner_type = TREE_TYPE (type);
+         tree r = build1 (REALPART_EXPR, inner_type, op);
+         tree i = build1 (IMAGPART_EXPR, inner_type, op);
+         gimple_seq list = set_component_ssa_name (op, false, r);
+
+         if (list)
+           gsi_insert_seq_after (gsi, list, GSI_CONTINUE_LINKING);
+
+         list = set_component_ssa_name (op, true, i);
+         if (list)
+           gsi_insert_seq_after (gsi, list, GSI_CONTINUE_LINKING);
+       }
+    }
+}
 
 /* Process one statement.  If we identify a complex operation, expand it.  */
 
@@ -1412,6 +1442,12 @@ expand_complex_operations_1 (gimple_stmt_iterator *gsi)
   complex_lattice_t al, bl;
   enum tree_code code;
 
+  if (gimple_code (stmt) == GIMPLE_ASM)
+    {
+      expand_complex_asm (gsi);
+      return;
+    }
+
   lhs = gimple_get_lhs (stmt);
   if (!lhs && gimple_code (stmt) != GIMPLE_COND)
     return;
@@ -1623,8 +1659,7 @@ struct gimple_opt_pass pass_lower_complex =
   PROP_gimple_lcx,                     /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
-  TODO_dump_func
-    | TODO_ggc_collect
+    TODO_ggc_collect
     | TODO_update_ssa
     | TODO_verify_stmts                        /* todo_flags_finish */
  }
@@ -1654,8 +1689,7 @@ struct gimple_opt_pass pass_lower_complex_O0 =
   PROP_gimple_lcx,                     /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
-  TODO_dump_func
-    | TODO_ggc_collect
+  TODO_ggc_collect
     | TODO_update_ssa
     | TODO_verify_stmts                        /* todo_flags_finish */
  }