OSDN Git Service

2010-04-19 Martin Jambor <mjambor@suse.cz>
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Apr 2010 17:58:54 +0000 (17:58 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 01:06:12 +0000 (10:06 +0900)
* gimple.h (create_tmp_reg): Declare.
* gimplify.c (create_tmp_reg): New function.
(gimplify_return_expr): Use create_tmp_reg.
(gimplify_omp_atomic): Likewise.
(gimple_regimplify_operands): Likewise.
* tree-dfa.c (make_rename_temp): Likewise.
* tree-predcom.c (predcom_tmp_var): Likewise.
(reassociate_to_the_same_stmt): Likewise.
* tree-sra.c (replace_uses_with_default_def_ssa_name): Likewise.
(get_replaced_param_substitute): Likewise.
* tree-ssa-phiprop.c (phiprop_insert_phi): Likewise.
* tree-ssa-phiopt.c (cond_store_replacement): Likewise.
* tree-ssa-pre.c (get_representative_for): Likewise.
(create_expression_by_pieces): Likewise.
* tree-tailcall.c (adjust_return_value_with_ops): Likewise.
(create_tailcall_accumulator): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158523 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/gimple.h
gcc/gimplify.c
gcc/tree-dfa.c
gcc/tree-sra.c
gcc/tree-tailcall.c

index 4e2e907..b21d8c5 100644 (file)
@@ -1,5 +1,24 @@
 2010-04-19  Martin Jambor  <mjambor@suse.cz>
 
+       * gimple.h (create_tmp_reg): Declare.
+       * gimplify.c (create_tmp_reg): New function.
+       (gimplify_return_expr): Use create_tmp_reg.
+       (gimplify_omp_atomic): Likewise.
+       (gimple_regimplify_operands): Likewise.
+       * tree-dfa.c (make_rename_temp): Likewise.
+       * tree-predcom.c (predcom_tmp_var): Likewise.
+       (reassociate_to_the_same_stmt): Likewise.
+       * tree-sra.c (replace_uses_with_default_def_ssa_name): Likewise.
+       (get_replaced_param_substitute): Likewise.
+       * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise.
+       * tree-ssa-phiopt.c (cond_store_replacement): Likewise.
+       * tree-ssa-pre.c (get_representative_for): Likewise.
+       (create_expression_by_pieces): Likewise.
+       * tree-tailcall.c (adjust_return_value_with_ops): Likewise.
+       (create_tailcall_accumulator): Likewise.
+
+2010-04-19  Martin Jambor  <mjambor@suse.cz>
+
        * cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Update
        new_stmt.
        (cgraph_materialize_all_clones): Assert !need_ssa_update_p.
index 18ebbb1..3daaa9e 100644 (file)
@@ -964,6 +964,7 @@ extern bool gimple_ior_addresses_taken (bitmap, gimple);
 extern tree create_tmp_var_raw (tree, const char *);
 extern tree create_tmp_var_name (const char *);
 extern tree create_tmp_var (tree, const char *);
+extern tree create_tmp_reg (tree, const char *);
 extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *);
 extern tree get_formal_tmp_var (tree, gimple_seq *);
 extern void declare_vars (tree, gimple, bool);
index a9eed84..287d621 100644 (file)
@@ -508,6 +508,23 @@ create_tmp_var (tree type, const char *prefix)
   return tmp_var;
 }
 
+/* Create a new temporary variable declaration of type TYPE by calling
+   create_tmp_var and if TYPE is a vector or a complex number, mark the new
+   temporary as gimple register.  */
+
+tree
+create_tmp_reg (tree type, const char *prefix)
+{
+  tree tmp;
+
+  tmp = create_tmp_var (type, prefix);
+  if (TREE_CODE (type) == COMPLEX_TYPE
+      || TREE_CODE (type) == VECTOR_TYPE)
+    DECL_GIMPLE_REG_P (tmp) = 1;
+
+  return tmp;
+}
+
 /* Create a temporary with a name derived from VAL.  Subroutine of
    lookup_tmp_var; nobody else should call this function.  */
 
@@ -1219,10 +1236,7 @@ gimplify_return_expr (tree stmt, gimple_seq *pre_p)
     result = gimplify_ctxp->return_temp;
   else
     {
-      result = create_tmp_var (TREE_TYPE (result_decl), NULL);
-      if (TREE_CODE (TREE_TYPE (result)) == COMPLEX_TYPE
-          || TREE_CODE (TREE_TYPE (result)) == VECTOR_TYPE)
-        DECL_GIMPLE_REG_P (result) = 1;
+      result = create_tmp_reg (TREE_TYPE (result_decl), NULL);
 
       /* ??? With complex control flow (usually involving abnormal edges),
         we can wind up warning about an uninitialized value for this.  Due
@@ -6351,9 +6365,7 @@ gimplify_omp_atomic (tree *expr_p, gimple_seq *pre_p)
   tree type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (addr)));
   tree tmp_load;
 
-   tmp_load = create_tmp_var (type, NULL);
-   if (TREE_CODE (type) == COMPLEX_TYPE || TREE_CODE (type) == VECTOR_TYPE)
-     DECL_GIMPLE_REG_P (tmp_load) = 1;
+   tmp_load = create_tmp_reg (type, NULL);
    if (goa_stabilize_expr (&rhs, pre_p, addr, tmp_load) < 0)
      return GS_ERROR;
 
@@ -7828,11 +7840,8 @@ gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p)
            }
          if (need_temp)
            {
-             tree temp = create_tmp_var (TREE_TYPE (lhs), NULL);
+             tree temp = create_tmp_reg (TREE_TYPE (lhs), NULL);
 
-             if (TREE_CODE (TREE_TYPE (lhs)) == COMPLEX_TYPE
-                 || TREE_CODE (TREE_TYPE (lhs)) == VECTOR_TYPE)
-               DECL_GIMPLE_REG_P (temp) = 1;
              if (TREE_CODE (orig_lhs) == SSA_NAME)
                orig_lhs = SSA_NAME_VAR (orig_lhs);
 
index 5475d79..d5a56e5 100644 (file)
@@ -193,11 +193,7 @@ renumber_gimple_stmt_uids_in_blocks (basic_block *blocks, int n_blocks)
 tree
 make_rename_temp (tree type, const char *prefix)
 {
-  tree t = create_tmp_var (type, prefix);
-
-  if (TREE_CODE (TREE_TYPE (t)) == COMPLEX_TYPE
-      || TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
-    DECL_GIMPLE_REG_P (t) = 1;
+  tree t = create_tmp_reg (type, prefix);
 
   if (gimple_referenced_vars (cfun))
     {
index 0a9b3df..0635aa7 100644 (file)
@@ -2537,10 +2537,7 @@ replace_uses_with_default_def_ssa_name (tree ssa)
   tree repl, decl = SSA_NAME_VAR (ssa);
   if (TREE_CODE (decl) == PARM_DECL)
     {
-      tree tmp = create_tmp_var (TREE_TYPE (decl), "SR");
-      if (TREE_CODE (TREE_TYPE (tmp)) == COMPLEX_TYPE
-         || TREE_CODE (TREE_TYPE (tmp)) == VECTOR_TYPE)
-       DECL_GIMPLE_REG_P (tmp) = 1;
+      tree tmp = create_tmp_reg (TREE_TYPE (decl), "SR");
 
       get_var_ann (tmp);
       add_referenced_var (tmp);
@@ -3733,10 +3730,7 @@ get_replaced_param_substitute (struct ipa_parm_adjustment *adj)
     {
       char *pretty_name = make_fancy_name (adj->base);
 
-      repl = create_tmp_var (TREE_TYPE (adj->base), "ISR");
-      if (TREE_CODE (TREE_TYPE (repl)) == COMPLEX_TYPE
-         || TREE_CODE (TREE_TYPE (repl)) == VECTOR_TYPE)
-       DECL_GIMPLE_REG_P (repl) = 1;
+      repl = create_tmp_reg (TREE_TYPE (adj->base), "ISR");
       DECL_NAME (repl) = get_identifier (pretty_name);
       obstack_free (&name_obstack, pretty_name);
 
index ca3dffa..4d2422a 100644 (file)
@@ -575,13 +575,10 @@ adjust_return_value_with_ops (enum tree_code code, const char *label,
 {
 
   tree ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
-  tree tmp = create_tmp_var (ret_type, label);
+  tree tmp = create_tmp_reg (ret_type, label);
   gimple stmt;
   tree result;
 
-  if (TREE_CODE (ret_type) == COMPLEX_TYPE
-      || TREE_CODE (ret_type) == VECTOR_TYPE)
-    DECL_GIMPLE_REG_P (tmp) = 1;
   add_referenced_var (tmp);
 
   if (types_compatible_p (TREE_TYPE (acc), TREE_TYPE (op1)))
@@ -908,12 +905,9 @@ static tree
 create_tailcall_accumulator (const char *label, basic_block bb, tree init)
 {
   tree ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
-  tree tmp = create_tmp_var (ret_type, label);
+  tree tmp = create_tmp_reg (ret_type, label);
   gimple phi;
 
-  if (TREE_CODE (ret_type) == COMPLEX_TYPE
-      || TREE_CODE (ret_type) == VECTOR_TYPE)
-    DECL_GIMPLE_REG_P (tmp) = 1;
   add_referenced_var (tmp);
   phi = create_phi_node (tmp, bb);
   /* RET_TYPE can be a float when -ffast-maths is enabled.  */