This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tuples] adjust vectorizer, c++ FE, and omp code


Hi folks.

This patch adjusts the vectorizer, the C++ front end, and the OMP code to
use GIMPLE_MODIFY_STMT tuples.  The gimplifier now generates
GIMPLE_MODIFY_STMT in its entirety and doesn't rely on iteration to fix up
MODIFY_EXPRs.

I have also moved the gimplified_flag from tree_function_decl, to struct
function, because I was running into problems with functions that were defined
twice, which have one fndecl, but two `struct function'.  This fixed one
regression.

With these changes, we have no regressions for C, and 2 regressions for
C++.  I have yet to tackle the other front ends (or attempt a bootstrap,
but I've just about worked up the courage).

I have applied the following patch to the branch.

Aldy

	* tree-complex.c (expand_complex_libcall): Adjust for
	GIMPLE_MODIFY_STMT.
	(expand_complex_comparison): Same.
	* tree-pretty-print.c (dump_generic_node): Is_expr should include
	GIMPLE_STMT_P statements.
	* value-prof.c (tree_divmod_fixed_value_transform): Adjust for
	GIMPLE_MODIFY_STMT.
	(tree_mod_pow2_value_transform): Same.
	(tree_mod_subtract_transform): Same.
	* tree.c (build2_stat): Check for gimplified function in cfun.
	* tree.h (DECL_GIMPLIFIED): Delete.
	(struct tree_function_decl): Remove gimplified_flag.
	* omp-low.c (lower_omp_for): Adjust for GIMPLE_MODIFY_STMT.
	* cp/cp-gimplify.c (cp_gimplify_expr): Adjust for GIMPLE_MODIFY_STMT.
	(cxx_omp_clause_apply_fn): Adjust for GIMPLE_MODIFY_STMT.
	(cxx_omp_clause_copy_ctor): Same.
	(cxx_omp_clause_assign_op): Same.
	* c-pretty-print.c (pp_c_conditional_expression): Same.
	(pp_c_expression): Same.
	* langhooks.c (lhd_omp_predetermined_sharing): Same.
	* function.h (struct function): Add gimplified field.
	* tree-if-conv.c (add_to_dst_predicate_list): Adjust for
	GIMPLE_MODIFY_STMT.
	(find_phi_replacement_condition): Same.
	* gimplify.c (gimplify_modify_expr_to_memcpy): Same.
	(gimplify_modify_expr_to_memset): Same.
	(gimplify_init_ctor_eval_range): Same.
	(gimplify_modify_expr_complex_part): Same.
	(tree_to_gimple_tuple): Same.
	(gimplify_modify_expr): Same.
	(gimple_push_cleanup): Same.
	(gimplify_omp_for): Same.
	(gimplify_omp_atomic_pipeline): Same.
	(gimplify_omp_atomic_mutex): Same.
	(gimplify_expr): Same.
	(gimplify_one_sizepos): Same.
	(gimplify_function_tree): Same.
	* tree-vect-patterns.c (vect_recog_dot_prod_pattern): Same.
	(vect_recog_widen_sum_pattern): Same.
	* tree-vect-transform.c (get_initial_def_for_reduction): Same.
	(vect_create_epilog_for_reduction): Same.
	(vectorizable_reduction): Same.

Index: tree-complex.c
===================================================================
--- tree-complex.c	(revision 117278)
+++ tree-complex.c	(working copy)
@@ -893,7 +893,7 @@ expand_complex_libcall (block_stmt_itera
   args = tree_cons (NULL, ar, args);
 
   stmt = bsi_stmt (*bsi);
-  type = TREE_TYPE (TREE_OPERAND (stmt, 1));
+  type = TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 1));
 
   mode = TYPE_MODE (type);
   gcc_assert (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT);
@@ -905,13 +905,13 @@ expand_complex_libcall (block_stmt_itera
     gcc_unreachable ();
   fn = built_in_decls[bcode];
 
-  TREE_OPERAND (stmt, 1)
+  GIMPLE_STMT_OPERAND (stmt, 1)
     = build3 (CALL_EXPR, type, build_fold_addr_expr (fn), args, NULL);
   update_stmt (stmt);
 
   if (in_ssa_p)
     {
-      tree lhs = TREE_OPERAND (stmt, 0);
+      tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
       type = TREE_TYPE (type);
       update_complex_components (bsi, stmt,
 				 build1 (REALPART_EXPR, type, lhs),
@@ -1307,8 +1307,8 @@ expand_complex_comparison (block_stmt_it
       expr = TREE_OPERAND (stmt, 0);
       /* FALLTHRU */
     case GIMPLE_MODIFY_STMT:
-      type = TREE_TYPE (TREE_OPERAND (expr, 1));
-      TREE_OPERAND (expr, 1) = fold_convert (type, cc);
+      type = TREE_TYPE (GIMPLE_STMT_OPERAND (expr, 1));
+      GIMPLE_STMT_OPERAND (expr, 1) = fold_convert (type, cc);
       break;
     case COND_EXPR:
       TREE_OPERAND (stmt, 0) = cc;
Index: tree-pretty-print.c
===================================================================
--- tree-pretty-print.c	(revision 117278)
+++ tree-pretty-print.c	(working copy)
@@ -419,7 +419,7 @@ dump_generic_node (pretty_printer *buffe
   if (node == NULL_TREE)
     return spc;
 
-  is_expr = EXPR_P (node);
+  is_expr = EXPR_P (node) || GIMPLE_STMT_P (node);
 
   if (TREE_CODE (node) != ERROR_MARK
       && is_gimple_stmt (node)
Index: value-prof.c
===================================================================
--- value-prof.c	(revision 117278)
+++ value-prof.c	(working copy)
@@ -326,7 +326,7 @@ tree_divmod_fixed_value_transform (tree 
       print_generic_stmt (dump_file, stmt, TDF_SLIM);
     }
 
-  TREE_OPERAND (modify, 1) = result;
+  GIMPLE_STMT_OPERAND (modify, 1) = result;
 
   return true;
 }
@@ -484,7 +484,7 @@ tree_mod_pow2_value_transform (tree stmt
 
   result = tree_mod_pow2 (stmt, op, op1, op2, prob, count, all);
 
-  TREE_OPERAND (modify, 1) = result;
+  GIMPLE_STMT_OPERAND (modify, 1) = result;
 
   return true;
 }
@@ -686,7 +686,7 @@ tree_mod_subtract_transform (tree stmt)
 			    histogram->hvalue.counters[0], 
 			    histogram->hvalue.counters[1], all);
 
-  TREE_OPERAND (modify, 1) = result;
+  GIMPLE_STMT_OPERAND (modify, 1) = result;
 
   return true;
 }
Index: tree.c
===================================================================
--- tree.c	(revision 117284)
+++ tree.c	(working copy)
@@ -2995,14 +2995,14 @@ build2_stat (enum tree_code code, tree t
 
   gcc_assert (TREE_CODE_LENGTH (code) == 2);
 
-  if (code == MODIFY_EXPR && DECL_GIMPLIFIED (current_function_decl))
+  if (code == MODIFY_EXPR && cfun && cfun->gimplified)
     {
       /* WTF?  We should be talking GIMPLE_MODIFY_STMT by now.  */
       gcc_unreachable ();
     }
 
-  /* For now let's be lazy; later we must rewrite all build2 calls to
-     build2_gimple calls.  */
+  /* FIXME tuples: For now let's be lazy; later we must rewrite all
+     build2 calls to build2_gimple calls.  */
   if (TREE_CODE_CLASS (code) == tcc_gimple_stmt)
     return build2_gimple (code, arg0, arg1);
 
Index: tree.h
===================================================================
--- tree.h	(revision 117284)
+++ tree.h	(working copy)
@@ -3116,10 +3116,6 @@ struct tree_decl_non_common GTY(())
 #define DECL_ARGUMENTS(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.arguments)
 #define DECL_ARGUMENT_FLD(NODE) (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.arguments)
 
-/* Nonzero in a FUNCTION_DECL if it has been high level gimplified.  */
-#define DECL_GIMPLIFIED(NODE) \
-  (FUNCTION_DECL_CHECK (NODE)->function_decl.gimplified_flag)
-
 /* FUNCTION_DECL inherits from DECL_NON_COMMON because of the use of the
    arguments/result/saved_tree fields by front ends.   It was either inherit
    FUNCTION_DECL from non_common, or inherit non_common from FUNCTION_DECL,
@@ -3144,10 +3140,6 @@ struct tree_function_decl GTY(())
   unsigned no_instrument_function_entry_exit : 1;
   unsigned no_limit_stack : 1;
   ENUM_BITFIELD(built_in_class) built_in_class : 2;
-  /* This bit is temporarily here to mark when a function has been
-     gimplified, so we can make sure we're not creating non GIMPLE tuples
-     after gimplification.  */
-  unsigned gimplified_flag : 1;
 
   struct function *f;
 };
Index: omp-low.c
===================================================================
--- omp-low.c	(revision 117278)
+++ omp-low.c	(working copy)
@@ -3995,7 +3995,7 @@ lower_omp_for (tree *stmt_p, omp_context
 
      We just need to make sure that VAL1, VAL2 and VAL3 are lowered
      using the .omp_data_s mapping, if needed.  */
-  rhs_p = &TREE_OPERAND (OMP_FOR_INIT (stmt), 1);
+  rhs_p = &GIMPLE_STMT_OPERAND (OMP_FOR_INIT (stmt), 1);
   if (!is_gimple_min_invariant (*rhs_p))
     *rhs_p = get_formal_tmp_var (*rhs_p, body_p);
 
@@ -4003,7 +4003,7 @@ lower_omp_for (tree *stmt_p, omp_context
   if (!is_gimple_min_invariant (*rhs_p))
     *rhs_p = get_formal_tmp_var (*rhs_p, body_p);
 
-  rhs_p = &TREE_OPERAND (TREE_OPERAND (OMP_FOR_INCR (stmt), 1), 1);
+  rhs_p = &TREE_OPERAND (GIMPLE_STMT_OPERAND (OMP_FOR_INCR (stmt), 1), 1);
   if (!is_gimple_min_invariant (*rhs_p))
     *rhs_p = get_formal_tmp_var (*rhs_p, body_p);
 
Index: cp/cp-gimplify.c
===================================================================
--- cp/cp-gimplify.c	(revision 117278)
+++ cp/cp-gimplify.c	(working copy)
@@ -483,7 +483,7 @@ cp_gimplify_expr (tree *expr_p, tree *pr
       ret = GS_OK;
       break;
 
-      /* We used to do this for MODIFY_EXPR as well, but that's unsafe; the
+      /* We used to do this for GIMPLE_MODIFY_STMT as well, but that's unsafe; the
 	 LHS of an assignment might also be involved in the RHS, as in bug
 	 25979.  */
     case INIT_EXPR:
@@ -784,13 +784,13 @@ cxx_omp_clause_apply_fn (tree fn, tree a
       end1 = build2 (PLUS_EXPR, TREE_TYPE (start1), start1, end1);
 
       p1 = create_tmp_var (TREE_TYPE (start1), NULL);
-      t = build2 (MODIFY_EXPR, void_type_node, p1, start1);
+      t = build2 (GIMPLE_MODIFY_STMT, void_type_node, p1, start1);
       append_to_statement_list (t, &ret);
 
       if (arg2)
 	{
 	  p2 = create_tmp_var (TREE_TYPE (start2), NULL);
-	  t = build2 (MODIFY_EXPR, void_type_node, p2, start2);
+	  t = build2 (GIMPLE_MODIFY_STMT, void_type_node, p2, start2);
 	  append_to_statement_list (t, &ret);
 	}
 
@@ -812,14 +812,14 @@ cxx_omp_clause_apply_fn (tree fn, tree a
 
       t = fold_convert (TREE_TYPE (p1), TYPE_SIZE_UNIT (inner_type));
       t = build2 (PLUS_EXPR, TREE_TYPE (p1), p1, t);
-      t = build2 (MODIFY_EXPR, void_type_node, p1, t);
+      t = build2 (GIMPLE_MODIFY_STMT, void_type_node, p1, t);
       append_to_statement_list (t, &ret);
 
       if (arg2)
 	{
 	  t = fold_convert (TREE_TYPE (p2), TYPE_SIZE_UNIT (inner_type));
 	  t = build2 (PLUS_EXPR, TREE_TYPE (p2), p2, t);
-	  t = build2 (MODIFY_EXPR, void_type_node, p2, t);
+	  t = build2 (GIMPLE_MODIFY_STMT, void_type_node, p2, t);
 	  append_to_statement_list (t, &ret);
 	}
 
@@ -870,7 +870,7 @@ cxx_omp_clause_copy_ctor (tree clause, t
   if (info)
     ret = cxx_omp_clause_apply_fn (TREE_VEC_ELT (info, 0), dst, src);
   if (ret == NULL)
-    ret = build2 (MODIFY_EXPR, void_type_node, dst, src);
+    ret = build2 (GIMPLE_MODIFY_STMT, void_type_node, dst, src);
 
   return ret;
 }
@@ -886,7 +886,7 @@ cxx_omp_clause_assign_op (tree clause, t
   if (info)
     ret = cxx_omp_clause_apply_fn (TREE_VEC_ELT (info, 2), dst, src);
   if (ret == NULL)
-    ret = build2 (MODIFY_EXPR, void_type_node, dst, src);
+    ret = build2 (GIMPLE_MODIFY_STMT, void_type_node, dst, src);
 
   return ret;
 }
Index: c-pretty-print.c
===================================================================
--- c-pretty-print.c	(revision 117278)
+++ c-pretty-print.c	(working copy)
@@ -1795,13 +1795,15 @@ pp_c_conditional_expression (c_pretty_pr
 static void
 pp_c_assignment_expression (c_pretty_printer *pp, tree e)
 {
-  if (TREE_CODE (e) == MODIFY_EXPR || TREE_CODE (e) == INIT_EXPR)
+  if (TREE_CODE (e) == MODIFY_EXPR 
+      || TREE_CODE (e) == GIMPLE_MODIFY_STMT
+      || TREE_CODE (e) == INIT_EXPR)
     {
-      pp_c_unary_expression (pp, TREE_OPERAND (e, 0));
+      pp_c_unary_expression (pp, PROTECTED_TREE_OPERAND (e, 0));
       pp_c_whitespace (pp);
       pp_equal (pp);
       pp_space (pp);
-      pp_c_expression (pp, TREE_OPERAND (e, 1));
+      pp_c_expression (pp, PROTECTED_TREE_OPERAND (e, 1));
     }
   else
     pp_c_conditional_expression (pp, e);
@@ -1942,6 +1944,7 @@ pp_c_expression (c_pretty_printer *pp, t
       break;
 
     case MODIFY_EXPR:
+    case GIMPLE_MODIFY_STMT:
     case INIT_EXPR:
       pp_assignment_expression (pp, e);
       break;
Index: langhooks.c
===================================================================
--- langhooks.c	(revision 117278)
+++ langhooks.c	(working copy)
@@ -577,7 +577,7 @@ lhd_omp_predetermined_sharing (tree decl
 tree
 lhd_omp_assignment (tree clause ATTRIBUTE_UNUSED, tree dst, tree src)
 {
-  return build2 (MODIFY_EXPR, void_type_node, dst, src);
+  return build2 (GIMPLE_MODIFY_STMT, void_type_node, dst, src);
 }
 
 /* Register language specific type size variables as potentially OpenMP
Index: function.h
===================================================================
--- function.h	(revision 117278)
+++ function.h	(working copy)
@@ -463,6 +463,11 @@ struct function GTY(())
   /* Number of units of floating point registers that need saving in stdarg
      function.  */
   unsigned int va_list_fpr_size : 8;
+
+  /* FIXME tuples: This bit is temporarily here to mark when a
+     function has been gimplified, so we can make sure we're not
+     creating non GIMPLE tuples after gimplification.  */
+  unsigned gimplified : 1;
 };
 
 /* If va_list_[gf]pr_size is set to this, it means we don't know how
Index: tree-if-conv.c
===================================================================
--- tree-if-conv.c	(revision 117284)
+++ tree-if-conv.c	(working copy)
@@ -636,7 +636,7 @@ add_to_dst_predicate_list (struct loop *
 		    unshare_expr (prev_cond), cond);
       tmp_stmt = ifc_temp_var (boolean_type_node, tmp);
       bsi_insert_before (bsi, tmp_stmt, BSI_SAME_STMT);
-      new_cond = TREE_OPERAND (tmp_stmt, 0);
+      new_cond = GIMPLE_STMT_OPERAND (tmp_stmt, 0);
     }
   add_to_predicate_list (bb, new_cond);
   return new_cond;
@@ -743,7 +743,7 @@ find_phi_replacement_condition (struct l
 
       new_stmt = ifc_temp_var (TREE_TYPE (*cond), unshare_expr (*cond));
       bsi_insert_before (bsi, new_stmt, BSI_SAME_STMT);
-      *cond = TREE_OPERAND (new_stmt, 0);
+      *cond = GIMPLE_STMT_OPERAND (new_stmt, 0);
     }
 
   gcc_assert (*cond);
Index: gimplify.c
===================================================================
--- gimplify.c	(revision 117278)
+++ gimplify.c	(working copy)
@@ -49,14 +49,6 @@ Software Foundation, 51 Franklin Street,
 #include "optabs.h"
 #include "pointer-set.h"
 
-/* FIXME tuples: This file needs major surgery.  We should ideally be building
-   GIMPLE_MODIFY_STMTs everywhere (ala build2(GIMPLE_MODIFY_STMT...)) instead
-   of building MODIFY_EXPRs and letting the recursion of gimplification take
-   care of it.  Of course, this will require careful analysis of what is
-   expecting to deal with MODIFY_EXPRs and what is expecting to deal with
-   newly built GIMPLE_MODIFY_STMT.  Oh well, lazy man's way now... let
-   recursion fix it :-).  */
-
 
 enum gimplify_omp_var_data
 {
@@ -2559,8 +2551,8 @@ gimplify_modify_expr_to_memcpy (tree *ex
 {
   tree args, t, to, to_ptr, from;
 
-  to = TREE_OPERAND (*expr_p, 0);
-  from = TREE_OPERAND (*expr_p, 1);
+  to = PROTECTED_TREE_OPERAND (*expr_p, 0);
+  from = PROTECTED_TREE_OPERAND (*expr_p, 1);
 
   args = tree_cons (NULL, size, NULL);
 
@@ -2591,7 +2583,7 @@ gimplify_modify_expr_to_memset (tree *ex
 {
   tree args, t, to, to_ptr;
 
-  to = TREE_OPERAND (*expr_p, 0);
+  to = PROTECTED_TREE_OPERAND (*expr_p, 0);
 
   args = tree_cons (NULL, size, NULL);
 
@@ -2755,7 +2747,8 @@ gimplify_init_ctor_eval_range (tree obje
   /* Create and initialize the index variable.  */
   var_type = TREE_TYPE (upper);
   var = create_tmp_var (var_type, NULL);
-  append_to_statement_list (build2 (MODIFY_EXPR, var_type, var, lower), pre_p);
+  append_to_statement_list (build2 (GIMPLE_MODIFY_STMT, var_type, var, lower),
+			    pre_p);
 
   /* Add the loop entry label.  */
   append_to_statement_list (build1 (LABEL_EXPR,
@@ -2776,7 +2769,7 @@ gimplify_init_ctor_eval_range (tree obje
     gimplify_init_ctor_eval (cref, CONSTRUCTOR_ELTS (value),
 			     pre_p, cleared);
   else
-    append_to_statement_list (build2 (MODIFY_EXPR, TREE_TYPE (cref),
+    append_to_statement_list (build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (cref),
 				      cref, value),
 			      pre_p);
 
@@ -2791,7 +2784,7 @@ gimplify_init_ctor_eval_range (tree obje
 		    pre_p);
 
   /* Otherwise, increment the index var...  */
-  append_to_statement_list (build2 (MODIFY_EXPR, var_type, var,
+  append_to_statement_list (build2 (GIMPLE_MODIFY_STMT, var_type, var,
 				    build2 (PLUS_EXPR, var_type, var,
 					    fold_convert (var_type,
 							  integer_one_node))),
@@ -3466,8 +3459,8 @@ gimplify_modify_expr_complex_part (tree 
   enum tree_code code, ocode;
   tree lhs, rhs, new_rhs, other, realpart, imagpart;
 
-  lhs = TREE_OPERAND (*expr_p, 0);
-  rhs = TREE_OPERAND (*expr_p, 1);
+  lhs = PROTECTED_TREE_OPERAND (*expr_p, 0);
+  rhs = PROTECTED_TREE_OPERAND (*expr_p, 1);
   code = TREE_CODE (lhs);
   lhs = TREE_OPERAND (lhs, 0);
 
@@ -3483,8 +3476,8 @@ gimplify_modify_expr_complex_part (tree 
   else
     new_rhs = build2 (COMPLEX_EXPR, TREE_TYPE (lhs), realpart, imagpart);
 
-  TREE_OPERAND (*expr_p, 0) = lhs;
-  TREE_OPERAND (*expr_p, 1) = new_rhs;
+  PROTECTED_TREE_OPERAND (*expr_p, 0) = lhs;
+  PROTECTED_TREE_OPERAND (*expr_p, 1) = new_rhs;
 
   if (want_value)
     {
@@ -3540,7 +3533,7 @@ tree_to_gimple_tuple (tree *tp)
         return;
       }
     default:
-      gcc_unreachable ();
+      break;
     }
 }
 
@@ -3570,6 +3563,10 @@ gimplify_modify_expr (tree *expr_p, tree
 	      || TREE_CODE (*expr_p) == GIMPLE_MODIFY_STMT
 	      || TREE_CODE (*expr_p) == INIT_EXPR);
 
+  /* FIXME tuples: We need to gimplify into GIMPLE_MODIFY_STMT right
+     away, so the helper functions below can be made to only handle
+     GIMPLE_MODIFY_STMT's, not MODIFY_EXPR as well.  */
+
   /* For zero sized types only gimplify the left hand side and right hand side
      as statements and throw away the assignment.  */
   if (zero_sized_type (TREE_TYPE (*from_p)))
@@ -4238,9 +4235,9 @@ gimple_push_cleanup (tree var, tree clea
       */
 
       tree flag = create_tmp_var (boolean_type_node, "cleanup");
-      tree ffalse = build2 (MODIFY_EXPR, void_type_node, flag,
+      tree ffalse = build2 (GIMPLE_MODIFY_STMT, void_type_node, flag,
 			    boolean_false_node);
-      tree ftrue = build2 (MODIFY_EXPR, void_type_node, flag,
+      tree ftrue = build2 (GIMPLE_MODIFY_STMT, void_type_node, flag,
 			   boolean_true_node);
       cleanup = build3 (COND_EXPR, void_type_node, flag, cleanup, NULL);
       wce = build1 (WITH_CLEANUP_EXPR, void_type_node, cleanup);
@@ -4953,6 +4950,8 @@ gimplify_omp_for (tree *expr_p, tree *pr
   ret |= gimplify_expr (&TREE_OPERAND (t, 1), &OMP_FOR_PRE_BODY (for_stmt),
 			NULL, is_gimple_val, fb_rvalue);
 
+  tree_to_gimple_tuple (&OMP_FOR_INIT (for_stmt));
+
   t = OMP_FOR_COND (for_stmt);
   gcc_assert (COMPARISON_CLASS_P (t));
   gcc_assert (TREE_OPERAND (t, 0) == decl);
@@ -4960,6 +4959,7 @@ gimplify_omp_for (tree *expr_p, tree *pr
   ret |= gimplify_expr (&TREE_OPERAND (t, 1), &OMP_FOR_PRE_BODY (for_stmt),
 			NULL, is_gimple_val, fb_rvalue);
 
+  tree_to_gimple_tuple (&OMP_FOR_INCR (for_stmt));
   t = OMP_FOR_INCR (for_stmt);
   switch (TREE_CODE (t))
     {
@@ -4973,13 +4973,13 @@ gimplify_omp_for (tree *expr_p, tree *pr
       goto build_modify;
     build_modify:
       t = build2 (PLUS_EXPR, TREE_TYPE (decl), decl, t);
-      t = build2 (MODIFY_EXPR, void_type_node, decl, t);
+      t = build2 (GIMPLE_MODIFY_STMT, void_type_node, decl, t);
       OMP_FOR_INCR (for_stmt) = t;
       break;
       
-    case MODIFY_EXPR:
-      gcc_assert (TREE_OPERAND (t, 0) == decl);
-      t = TREE_OPERAND (t, 1);
+    case GIMPLE_MODIFY_STMT:
+      gcc_assert (GIMPLE_STMT_OPERAND (t, 0) == decl);
+      t = GIMPLE_STMT_OPERAND (t, 1);
       switch (TREE_CODE (t))
 	{
 	case PLUS_EXPR:
@@ -5189,7 +5189,7 @@ gimplify_omp_atomic_pipeline (tree *expr
     return GS_ERROR;
 
   x = build_fold_indirect_ref (addr);
-  x = build2 (MODIFY_EXPR, void_type_node, oldval, x);
+  x = build2 (GIMPLE_MODIFY_STMT, void_type_node, oldval, x);
   gimplify_and_add (x, pre_p);
 
   /* For floating-point values, we'll need to view-convert them to integers
@@ -5207,7 +5207,7 @@ gimplify_omp_atomic_pipeline (tree *expr
       newival = create_tmp_var (itype, NULL);
 
       x = build1 (VIEW_CONVERT_EXPR, itype, oldval);
-      x = build2 (MODIFY_EXPR, void_type_node, oldival, x);
+      x = build2 (GIMPLE_MODIFY_STMT, void_type_node, oldival, x);
       gimplify_and_add (x, pre_p);
       iaddr = fold_convert (build_pointer_type (itype), addr);
     }
@@ -5218,17 +5218,17 @@ gimplify_omp_atomic_pipeline (tree *expr
   x = build1 (LABEL_EXPR, void_type_node, label);
   gimplify_and_add (x, pre_p);
 
-  x = build2 (MODIFY_EXPR, void_type_node, newval, rhs);
+  x = build2 (GIMPLE_MODIFY_STMT, void_type_node, newval, rhs);
   gimplify_and_add (x, pre_p);
 
   if (newval != newival)
     {
       x = build1 (VIEW_CONVERT_EXPR, itype, newval);
-      x = build2 (MODIFY_EXPR, void_type_node, newival, x);
+      x = build2 (GIMPLE_MODIFY_STMT, void_type_node, newival, x);
       gimplify_and_add (x, pre_p);
     }
 
-  x = build2 (MODIFY_EXPR, void_type_node, oldival2,
+  x = build2 (GIMPLE_MODIFY_STMT, void_type_node, oldival2,
 	      fold_convert (itype, oldival));
   gimplify_and_add (x, pre_p);
 
@@ -5238,14 +5238,14 @@ gimplify_omp_atomic_pipeline (tree *expr
   x = build_function_call_expr (cmpxchg, args);
   if (oldval == oldival)
     x = fold_convert (type, x);
-  x = build2 (MODIFY_EXPR, void_type_node, oldival, x);
+  x = build2 (GIMPLE_MODIFY_STMT, void_type_node, oldival, x);
   gimplify_and_add (x, pre_p);
 
   /* For floating point, be prepared for the loop backedge.  */
   if (oldval != oldival)
     {
       x = build1 (VIEW_CONVERT_EXPR, type, oldival);
-      x = build2 (MODIFY_EXPR, void_type_node, oldval, x);
+      x = build2 (GIMPLE_MODIFY_STMT, void_type_node, oldval, x);
       gimplify_and_add (x, pre_p);
     }
 
@@ -5283,7 +5283,7 @@ gimplify_omp_atomic_mutex (tree *expr_p,
   gimplify_and_add (t, pre_p);
 
   t = build_fold_indirect_ref (addr);
-  t = build2 (MODIFY_EXPR, void_type_node, t, rhs);
+  t = build2 (GIMPLE_MODIFY_STMT, void_type_node, t, rhs);
   gimplify_and_add (t, pre_p);
   
   t = built_in_decls[BUILT_IN_GOMP_ATOMIC_END];
@@ -5952,7 +5952,7 @@ gimplify_expr (tree *expr_p, tree *pre_p
 	     given a TREE_ADDRESSABLE type.  */
 	  tree tmp = create_tmp_var_raw (type, "vol");
 	  gimple_add_tmp_var (tmp);
-	  *expr_p = build2 (MODIFY_EXPR, type, tmp, *expr_p);
+	  *expr_p = build2 (GIMPLE_MODIFY_STMT, type, tmp, *expr_p);
 	}
       else
 	/* We can't do anything useful with a volatile reference to
@@ -6170,7 +6170,7 @@ gimplify_one_sizepos (tree *expr_p, tree
 
       *expr_p = create_tmp_var (type, NULL);
       tmp = build1 (NOP_EXPR, type, expr);
-      tmp = build2 (MODIFY_EXPR, type, *expr_p, tmp);
+      tmp = build2 (GIMPLE_MODIFY_STMT, type, *expr_p, tmp);
       if (EXPR_HAS_LOCATION (expr))
 	SET_EXPR_LOCUS (tmp, EXPR_LOCUS (expr));
       else
@@ -6393,7 +6393,7 @@ gimplify_function_tree (tree fndecl)
       DECL_SAVED_TREE (fndecl) = bind;
     }
 
-  DECL_GIMPLIFIED (current_function_decl) = 1;
+  cfun->gimplified = true;
   current_function_decl = oldfn;
   cfun = oldfn ? DECL_STRUCT_FUNCTION (oldfn) : NULL;
 }
Index: tree-vect-patterns.c
===================================================================
--- tree-vect-patterns.c	(revision 117284)
+++ tree-vect-patterns.c	(working copy)
@@ -226,7 +226,7 @@ vect_recog_dot_prod_pattern (tree last_s
       if (widened_name_p (oprnd0, stmt, &half_type, &def_stmt))
         {
           stmt = def_stmt;
-          expr = TREE_OPERAND (stmt, 1);
+          expr = GIMPLE_STMT_OPERAND (stmt, 1);
           oprnd0 = TREE_OPERAND (expr, 0);
         }
       else
@@ -245,7 +245,7 @@ vect_recog_dot_prod_pattern (tree last_s
   gcc_assert (stmt_vinfo);
   if (STMT_VINFO_DEF_TYPE (stmt_vinfo) != vect_loop_def)
     return NULL;
-  expr = TREE_OPERAND (stmt, 1);
+  expr = GIMPLE_STMT_OPERAND (stmt, 1);
   if (TREE_CODE (expr) != MULT_EXPR)
     return NULL;
   if (STMT_VINFO_IN_PATTERN_P (stmt_vinfo))
@@ -253,7 +253,7 @@ vect_recog_dot_prod_pattern (tree last_s
       /* Has been detected as a widening multiplication?  */
 
       stmt = STMT_VINFO_RELATED_STMT (stmt_vinfo);
-      expr = TREE_OPERAND (stmt, 1);
+      expr = GIMPLE_STMT_OPERAND (stmt, 1);
       if (TREE_CODE (expr) != WIDEN_MULT_EXPR)
         return NULL;
       stmt_vinfo = vinfo_for_stmt (stmt);
@@ -277,10 +277,10 @@ vect_recog_dot_prod_pattern (tree last_s
         return NULL;
       if (!widened_name_p (oprnd0, stmt, &half_type0, &def_stmt))
         return NULL;
-      oprnd00 = TREE_OPERAND (TREE_OPERAND (def_stmt, 1), 0);
+      oprnd00 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 0);
       if (!widened_name_p (oprnd1, stmt, &half_type1, &def_stmt))
         return NULL;
-      oprnd01 = TREE_OPERAND (TREE_OPERAND (def_stmt, 1), 0);
+      oprnd01 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 0);
       if (TYPE_MAIN_VARIANT (half_type0) != TYPE_MAIN_VARIANT (half_type1))
         return NULL;
       if (TYPE_PRECISION (prod_type) != TYPE_PRECISION (half_type0) * 2)
@@ -421,7 +421,7 @@ vect_recog_widen_sum_pattern (tree last_
   if (!widened_name_p (oprnd0, last_stmt, &half_type, &stmt))
     return NULL;
 
-  oprnd0 = TREE_OPERAND (TREE_OPERAND (stmt, 1), 0);
+  oprnd0 = TREE_OPERAND (GIMPLE_STMT_OPERAND (stmt, 1), 0);
   *type_in = half_type;
   *type_out = type;
 
Index: tree-vect-transform.c
===================================================================
--- tree-vect-transform.c	(revision 117284)
+++ tree-vect-transform.c	(working copy)
@@ -647,7 +647,7 @@ get_initial_def_for_reduction (tree stmt
   tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
   int nunits = GET_MODE_NUNITS (TYPE_MODE (vectype));
   int nelements;
-  enum tree_code code = TREE_CODE (TREE_OPERAND (stmt, 1));
+  enum tree_code code = TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1));
   tree type = TREE_TYPE (init_val);
   tree def;
   tree vec, t = NULL_TREE;
@@ -783,7 +783,7 @@ vect_create_epilog_for_reduction (tree v
   tree epilog_stmt;
   tree new_scalar_dest, exit_phi;
   tree bitsize, bitpos, bytesize; 
-  enum tree_code code = TREE_CODE (TREE_OPERAND (stmt, 1));
+  enum tree_code code = TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1));
   tree scalar_initial_def;
   tree vec_initial_def;
   tree orig_name;
@@ -793,7 +793,7 @@ vect_create_epilog_for_reduction (tree v
   tree reduction_op;
   tree orig_stmt;
   tree use_stmt;
-  tree operation = TREE_OPERAND (stmt, 1);
+  tree operation = GIMPLE_STMT_OPERAND (stmt, 1);
   int op_type;
   
   op_type = TREE_CODE_LENGTH (TREE_CODE (operation));
@@ -880,8 +880,8 @@ vect_create_epilog_for_reduction (tree v
       gcc_assert (STMT_VINFO_IN_PATTERN_P (stmt_vinfo));
       gcc_assert (STMT_VINFO_RELATED_STMT (stmt_vinfo) == stmt);
     }
-  code = TREE_CODE (TREE_OPERAND (orig_stmt, 1));
-  scalar_dest = TREE_OPERAND (orig_stmt, 0);
+  code = TREE_CODE (GIMPLE_STMT_OPERAND (orig_stmt, 1));
+  scalar_dest = GIMPLE_STMT_OPERAND (orig_stmt, 0);
   scalar_type = TREE_TYPE (scalar_dest);
   new_scalar_dest = vect_create_destination_var (scalar_dest, NULL);
   bitsize = TYPE_SIZE (scalar_type);
@@ -1303,7 +1303,7 @@ vectorizable_reduction (tree stmt, block
     {
       /* This is a reduction pattern: get the vectype from the type of the
          reduction variable, and get the tree-code from orig_stmt.  */
-      orig_code = TREE_CODE (TREE_OPERAND (orig_stmt, 1));
+      orig_code = TREE_CODE (GIMPLE_STMT_OPERAND (orig_stmt, 1));
       vectype = get_vectype_for_scalar_type (TREE_TYPE (def));
       vec_mode = TYPE_MODE (vectype);
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]