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]

Re: [PATCH][TUPLES] Converting tree-tailcall.c to use GIMPLE.


On 4/3/08 9:21 PM, Doug Kwan (éæå) wrote:

@@ -121,7 +116,8 @@ struct tailcall
/* The variables holding the value of multiplicative and additive
accumulator. */
-static tree m_acc, a_acc;
+static GTY(()) tree m_acc;
+static GTY(()) tree a_acc;

As Zdenek pointed out, you don't need to GTY(()) these two.


- for (bsi = bsi_last (bb); !bsi_end_p (bsi); bsi_prev (&bsi))
+ for (gsi = gsi_last (bb_seq (bb)); !gsi_end_p (gsi); gsi_prev (&gsi))

s/gsi_last (bb_seq (bb))/gsi_last_bb (bb)/


 	{
 	  ass_var = propagate_through_phis (ass_var, single_succ_edge (abb));
 	  abb = single_succ (abb);
-	  absi = bsi_start (abb);
+	  agsi = gsi_start (bb_seq (abb));

s/gsi_start (bb_seq (abb))/gsi_start_bb (abb)/


@@ -545,15 +526,70 @@ find_tail_calls (basic_block bb, struct *ret = nw;
}
-/* Adjust the accumulator values according to A and M after BSI, and update
- the phi nodes on edge BACK. */
+/* Helper to insert phi_arg to the phi of var in the destination of edge e. */

Argument names should be in capitals.


-	 arg = first_call_expr_arg (stmt, &iter),
-	 phi = phi_nodes (first);
+	 idx = 0, gsi = gsi_start (phi_nodes (first));

s/gsi_start (phi_nodes (first))/gsi_start_phis (first)/



@@ -208,6 +209,9 @@ gimple_to_tree (gimple stmt)
         /* If the call has a LHS then create a MODIFY_EXPR to hold it.  */
         if (gimple_call_lhs (stmt))
           t = build_gimple_modify_stmt (gimple_call_lhs (stmt), t);
+
+	/* If GIMPLE is marked as a tail-call, do the same to tree.  */
+	CALL_EXPR_TAILCALL (call) = gimple_call_tail_p (stmt);

Should not be needed anymore. I fixed this with the last inliner patch.


OK with those changes.


Diego.



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