[tuples] rs6000: remove GIMPLE_MODIFY_STMT

Aldy Hernandez aldyh@redhat.com
Mon Jul 14 20:38:00 GMT 2008


This converts the PPC backend.  I also changed fixed one GOTO_EXPR where
we were building it, and gimplifying it immediately after.

Minor testing-- ok so I only built cc1.

David (PPC folk), I'm going to commit this, as without it you can't even
build the compiler.  Can you let me know if you see anything strange in
the next day or so?

Aldy

	* config/rs6000/rs6000.c (rs6000_va_start): Change
	GIMPLE_MODIFY_STMT to MODIFY_EXPR.
	(rs6000_gimplify_va_arg): Use gimplify_assign.
	Build GIMPLE_GOTO directly.

Index: config/rs6000/rs6000.c
===================================================================
--- config/rs6000/rs6000.c	(revision 137793)
+++ config/rs6000/rs6000.c	(working copy)
@@ -6733,7 +6733,7 @@ rs6000_va_start (tree valist, rtx nextar
 
   if (cfun->va_list_gpr_size)
     {
-      t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (gpr), gpr,
+      t = build2 (MODIFY_EXPR, TREE_TYPE (gpr), gpr,
 		  build_int_cst (NULL_TREE, n_gpr));
       TREE_SIDE_EFFECTS (t) = 1;
       expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -6741,7 +6741,7 @@ rs6000_va_start (tree valist, rtx nextar
 
   if (cfun->va_list_fpr_size)
     {
-      t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (fpr), fpr,
+      t = build2 (MODIFY_EXPR, TREE_TYPE (fpr), fpr,
 		  build_int_cst (NULL_TREE, n_fpr));
       TREE_SIDE_EFFECTS (t) = 1;
       expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -6752,7 +6752,7 @@ rs6000_va_start (tree valist, rtx nextar
   if (words != 0)
     t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ovf), t,
 	        size_int (words * UNITS_PER_WORD));
-  t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (ovf), ovf, t);
+  t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t);
   TREE_SIDE_EFFECTS (t) = 1;
   expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
 
@@ -6769,7 +6769,7 @@ rs6000_va_start (tree valist, rtx nextar
   if (cfun->machine->varargs_save_offset)
     t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (sav), t,
 	        size_int (cfun->machine->varargs_save_offset));
-  t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (sav), sav, t);
+  t = build2 (MODIFY_EXPR, TREE_TYPE (sav), sav, t);
   TREE_SIDE_EFFECTS (t) = 1;
   expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
 }
@@ -6930,11 +6930,9 @@ rs6000_gimplify_va_arg (tree valist, tre
 	  && TYPE_MODE (type) == SDmode)
 	t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t, size_int (size));
 
-      t = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
-      gimplify_and_add (t, pre_p);
+      gimplify_assign (addr, t, pre_p);
 
-      t = build1 (GOTO_EXPR, void_type_node, lab_over);
-      gimplify_and_add (t, pre_p);
+      gimple_seq_add_stmt (pre_p, gimple_build_goto (lab_over));
 
       stmt = gimple_build_label (lab_false);
       gimple_seq_add_stmt (pre_p, stmt);
@@ -6943,9 +6941,7 @@ rs6000_gimplify_va_arg (tree valist, tre
 	{
 	  /* Ensure that we don't find any more args in regs.
 	     Alignment has taken care of for special cases.  */
-	  t = build_gimple_modify_stmt (reg,
-					build_int_cst (TREE_TYPE (reg), 8));
-	  gimplify_and_add (t, pre_p);
+	  gimplify_assign (reg, build_int_cst (TREE_TYPE (reg), 8), pre_p);
 	}
     }
 
@@ -6963,12 +6959,10 @@ rs6000_gimplify_va_arg (tree valist, tre
     }
   gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
 
-  u = build2 (GIMPLE_MODIFY_STMT, void_type_node, unshare_expr (addr), t);
-  gimplify_and_add (u, pre_p);
+  gimplify_assign (unshare_expr (addr), t, pre_p);
 
   t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t, size_int (size));
-  t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (ovf), unshare_expr (ovf), t);
-  gimplify_and_add (t, pre_p);
+  gimplify_assign (unshare_expr (ovf), t, pre_p);
 
   if (lab_over)
     {



More information about the Gcc-patches mailing list