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] RTL expansion



This is the first in a series of patches to enable RTL expansion from gimple. It's still non-functional, so RTL expansion still doesn't really do anything. I'm trying to flush these patches incrementally to avoid huge local changes.


This mostly changes the code that expects to find the function body in DECL_SAVED_TREE and converts a couple of RTL expanders. The strategy I'm using is a temporary compromise so we can get the branch to generate code quickly.

Instead of converting all the tree-RTL machinery at once, I will start converting the toplevel functions first. The low-level tree-RTL functions will still not be converted, so I've added a local hack in cfgexpand.c that takes a gimple statement and returns the same statement in tree format.

Once I have basic RTL generation working, I will continue converting the low-level tree-RTL functions. This will simplify the conversion process.

Tested on x86_64. Committed.


Diego.
Index: cgraph.c
===================================================================
--- cgraph.c	(revision 130232)
+++ cgraph.c	(working copy)
@@ -341,7 +341,7 @@ cgraph_create_edge (struct cgraph_node *
 
   gcc_assert (gimple_code (call_stmt) == GIMPLE_CALL);
 
-  if (!DECL_SAVED_TREE (callee->decl))
+  if (!gimple_body (callee->decl))
     edge->inline_failed = N_("function body not available");
   else if (callee->local.redefined_extern_inline)
     edge->inline_failed = N_("redefined extern inline functions are not "
@@ -698,7 +698,7 @@ dump_cgraph_node (FILE *f, struct cgraph
     fprintf (f, " needed");
   else if (node->reachable)
     fprintf (f, " reachable");
-  if (DECL_SAVED_TREE (node->decl))
+  if (gimple_body (node->decl))
     fprintf (f, " tree");
   if (node->output)
     fprintf (f, " output");
Index: cgraphunit.c
===================================================================
--- cgraphunit.c	(revision 130232)
+++ cgraphunit.c	(working copy)
@@ -742,7 +742,8 @@ verify_cgraph_node (struct cgraph_node *
     }
 
   if (node->analyzed
-      && DECL_SAVED_TREE (node->decl) && !TREE_ASM_WRITTEN (node->decl)
+      && gimple_body (node->decl)
+      && !TREE_ASM_WRITTEN (node->decl)
       && (!DECL_EXTERNAL (node->decl) || node->global.inlined_to))
     {
       if (this_cfun->cfg)
@@ -976,7 +977,7 @@ cgraph_analyze_functions (void)
     {
       fprintf (cgraph_dump_file, "Initial entry points:");
       for (node = cgraph_nodes; node != first_analyzed; node = node->next)
-	if (node->needed && DECL_SAVED_TREE (node->decl))
+	if (node->needed && gimple_body (node->decl))
 	  fprintf (cgraph_dump_file, " %s", cgraph_node_name (node));
       fprintf (cgraph_dump_file, "\n");
     }
@@ -1027,7 +1028,7 @@ cgraph_analyze_functions (void)
     {
       fprintf (cgraph_dump_file, "Unit entry points:");
       for (node = cgraph_nodes; node != first_analyzed; node = node->next)
-	if (node->needed && DECL_SAVED_TREE (node->decl))
+	if (node->needed && gimple_body (node->decl))
 	  fprintf (cgraph_dump_file, " %s", cgraph_node_name (node));
       fprintf (cgraph_dump_file, "\n\nInitial ");
       dump_cgraph (cgraph_dump_file);
@@ -1041,10 +1042,10 @@ cgraph_analyze_functions (void)
       tree decl = node->decl;
       next = node->next;
 
-      if (node->local.finalized && !DECL_SAVED_TREE (decl))
+      if (node->local.finalized && !gimple_body (decl))
 	cgraph_reset_node (node);
 
-      if (!node->reachable && DECL_SAVED_TREE (decl))
+      if (!node->reachable && gimple_body (decl))
 	{
 	  if (cgraph_dump_file)
 	    fprintf (cgraph_dump_file, " %s", cgraph_node_name (node));
@@ -1053,7 +1054,7 @@ cgraph_analyze_functions (void)
 	}
       else
 	node->next_needed = NULL;
-      gcc_assert (!node->local.finalized || DECL_SAVED_TREE (decl));
+      gcc_assert (!node->local.finalized || gimple_body (decl));
       gcc_assert (node->analyzed == node->local.finalized);
     }
   if (cgraph_dump_file)
@@ -1114,7 +1115,7 @@ cgraph_mark_functions_to_output (void)
       /* We need to output all local functions that are used and not
 	 always inlined, as well as those that are reachable from
 	 outside the current compilation unit.  */
-      if (DECL_SAVED_TREE (decl)
+      if (gimple_body (decl)
 	  && !node->global.inlined_to
 	  && (node->needed
 	      || (e && node->reachable))
@@ -1125,14 +1126,16 @@ cgraph_mark_functions_to_output (void)
 	{
 	  /* We should've reclaimed all functions that are not needed.  */
 #ifdef ENABLE_CHECKING
-	  if (!node->global.inlined_to && DECL_SAVED_TREE (decl)
+	  if (!node->global.inlined_to
+	      && gimple_body (decl)
 	      && !DECL_EXTERNAL (decl))
 	    {
 	      dump_cgraph_node (stderr, node);
 	      internal_error ("failed to reclaim unneeded function");
 	    }
 #endif
-	  gcc_assert (node->global.inlined_to || !DECL_SAVED_TREE (decl)
+	  gcc_assert (node->global.inlined_to
+		      || !gimple_body (decl)
 		      || DECL_EXTERNAL (decl));
 
 	}
@@ -1457,7 +1460,7 @@ cgraph_optimize (void)
       for (node = cgraph_nodes; node; node = node->next)
 	if (node->analyzed
 	    && (node->global.inlined_to
-		|| DECL_SAVED_TREE (node->decl)))
+		|| gimple_body (node->decl)))
 	  {
 	    error_found = true;
 	    dump_cgraph_node (stderr, node);
Index: tree-eh.c
===================================================================
--- tree-eh.c	(revision 130232)
+++ tree-eh.c	(working copy)
@@ -1721,9 +1721,10 @@ lower_eh_constructs_1 (struct leh_state 
 static unsigned int
 lower_eh_constructs (void)
 {
-  /* FIXME tuples  */
+  /* FIXME tuples.  */
 #if 0
   struct leh_state null_state;
+  /* FIXME tuples.  DECL_SAVED_TREE needs to be changed to gimple_body.  */
   tree *tp = &DECL_SAVED_TREE (current_function_decl);
 
   finally_tree = htab_create (31, struct_ptr_hash, struct_ptr_eq, free);
@@ -2451,6 +2452,7 @@ refactor_eh_r (tree t)
 static unsigned
 refactor_eh (void)
 {
+  /* FIXME tuples.  DECL_SAVED_TREE needs to be changed to gimple_body.  */
   refactor_eh_r (DECL_SAVED_TREE (current_function_decl));
   return 0;
 }
Index: cfgexpand.c
===================================================================
--- cfgexpand.c	(revision 130232)
+++ cfgexpand.c	(working copy)
@@ -41,6 +41,68 @@ along with GCC; see the file COPYING3.  
 #include "tree-inline.h"
 #include "value-prof.h"
 
+/* FIXME tuples.  THIS IS A HACK.  DO NOT USE.
+
+   RTL expansion has traditionally been done on trees, so the
+   transition to doing it on GIMPLE tuples is very invasive to the RTL
+   expander.  To facilitate the transition, this function takes a
+   GIMPLE tuple STMT and returns the same statement in the form of a
+   tree.
+
+   This mechanism is ONLY used during the transition and will not be
+   merged into mainline.  If you think you need this function for
+   other uses, you are most likely wrong.  */
+
+static tree
+gimple_to_tree (gimple stmt)
+{
+  tree t;
+
+  switch (gimple_code (stmt))
+    {
+    case GIMPLE_ASSIGN:
+      {
+	enum gimple_rhs_class class;
+	
+	class = get_gimple_rhs_class (gimple_subcode (stmt));
+	if (class == GIMPLE_BINARY_RHS)
+	  t = build2 (gimple_assign_subcode (stmt),
+		      TREE_TYPE (gimple_assign_lhs (stmt)),
+		      gimple_assign_rhs1 (stmt),
+		      gimple_assign_rhs2 (stmt));
+	else if (class == GIMPLE_UNARY_RHS)
+	  t = build1 (gimple_assign_subcode (stmt),
+		      TREE_TYPE (gimple_assign_lhs (stmt)),
+		      gimple_assign_rhs1 (stmt));
+	else if (class == GIMPLE_SINGLE_RHS)
+	  t = gimple_assign_rhs1 (stmt);
+	else
+	  gcc_unreachable ();
+	
+	return build_gimple_modify_stmt (gimple_assign_lhs (stmt), t);
+      }
+	                                 
+    case GIMPLE_COND:
+      t = build2 (gimple_cond_code (stmt), boolean_type_node,
+	          gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
+      return build3 (COND_EXPR, void_type_node, t, NULL_TREE, NULL_TREE);
+
+    case GIMPLE_GOTO:
+      return build1 (GOTO_EXPR, void_type_node, gimple_goto_dest (stmt));
+
+    case GIMPLE_LABEL:
+      return build1 (LABEL_EXPR, void_type_node, gimple_label_label (stmt));
+
+    case GIMPLE_SWITCH:
+    case GIMPLE_ASM:
+    case GIMPLE_CALL:
+    case GIMPLE_RETURN:
+    default:
+      gcc_unreachable ();
+    }
+}
+
+
 /* Verify that there is exactly single jump instruction since last and attach
    REG_BR_PROB note specifying probability.
    ??? We really ought to pass the probability down to RTL expanders and let it
@@ -1225,21 +1287,18 @@ expand_used_vars (void)
    for STMT to the dump file.  SINCE is the last RTX after which the RTL
    generated for STMT should have been appended.  */
 
-/* FIXME tuples.  */
-#if 0
 static void
-maybe_dump_rtl_for_tree_stmt (tree stmt, rtx since)
+maybe_dump_rtl_for_gimple_stmt (gimple stmt, rtx since)
 {
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
       fprintf (dump_file, "\n;; ");
-      print_generic_expr (dump_file, stmt, TDF_SLIM);
+      print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
       fprintf (dump_file, "\n");
 
       print_rtl (dump_file, since ? NEXT_INSN (since) : since);
     }
 }
-#endif
 
 /* Maps the blocks that do not contain tree labels to rtx labels.  */
 
@@ -1247,12 +1306,10 @@ static struct pointer_map_t *lab_rtx_for
 
 /* Returns the label_rtx expression for a label starting basic block BB.  */
 
-/* FIXME tuples.  */
-#if 0
 static rtx
 label_rtx_for_bb (basic_block bb ATTRIBUTE_UNUSED)
 {
-  tree_stmt_iterator *gsi;
+  gimple_stmt_iterator *gsi;
   tree lab;
   gimple lab_stmt;
   void **elt;
@@ -1283,33 +1340,32 @@ label_rtx_for_bb (basic_block bb ATTRIBU
   *elt = gen_label_rtx ();
   return (rtx) *elt;
 }
-#endif
 
-/* A subroutine of expand_gimple_basic_block.  Expand one COND_EXPR.
+
+/* A subroutine of expand_gimple_basic_block.  Expand one GIMPLE_COND.
    Returns a new basic block if we've terminated the current basic
    block and created a new one.  */
 
-/* FIXME tuples.  */
-#if 0
 static basic_block
-expand_gimple_cond_expr (basic_block bb, tree stmt)
+expand_gimple_cond (basic_block bb, gimple stmt)
 {
   basic_block new_bb, dest;
   edge new_edge;
   edge true_edge;
   edge false_edge;
-  tree pred = COND_EXPR_COND (stmt);
+  tree stmt_tree = gimple_to_tree (stmt);
+  tree pred = COND_EXPR_COND (stmt_tree);
   rtx last2, last;
 
-  gcc_assert (COND_EXPR_THEN (stmt) == NULL_TREE);
-  gcc_assert (COND_EXPR_ELSE (stmt) == NULL_TREE);
+  gcc_assert (COND_EXPR_THEN (stmt_tree) == NULL_TREE);
+  gcc_assert (COND_EXPR_ELSE (stmt_tree) == NULL_TREE);
   last2 = last = get_last_insn ();
 
   extract_true_false_edges_from_block (bb, &true_edge, &false_edge);
-  if (EXPR_LOCUS (stmt))
+  if (!gimple_locus_empty_p (stmt))
     {
-      set_curr_insn_source_location (*(EXPR_LOCUS (stmt)));
-      set_curr_insn_block (TREE_BLOCK (stmt));
+      set_curr_insn_source_location (gimple_locus (stmt));
+      set_curr_insn_block (gimple_block (stmt));
     }
 
   /* These flags have no purpose in RTL land.  */
@@ -1322,14 +1378,9 @@ expand_gimple_cond_expr (basic_block bb,
     {
       jumpif (pred, label_rtx_for_bb (true_edge->dest));
       add_reg_br_prob_note (last, true_edge->probability);
-      maybe_dump_rtl_for_tree_stmt (stmt, last);
-      /* FIXME tuples.  */
-#if 0
-      if (true_edge->goto_locus)
-  	set_curr_insn_source_location (location_from_locus (true_edge->goto_locus));
-#else
-      gcc_unreachable ();
-#endif
+      maybe_dump_rtl_for_gimple_stmt (stmt, last);
+      if (!IS_LOCATION_EMPTY (true_edge->goto_locus))
+  	set_curr_insn_source_location (true_edge->goto_locus);
       false_edge->flags |= EDGE_FALLTHRU;
       return NULL;
     }
@@ -1337,14 +1388,9 @@ expand_gimple_cond_expr (basic_block bb,
     {
       jumpifnot (pred, label_rtx_for_bb (false_edge->dest));
       add_reg_br_prob_note (last, false_edge->probability);
-      maybe_dump_rtl_for_tree_stmt (stmt, last);
-      /* FIXME tuples.  */
-#if 0
-      if (false_edge->goto_locus)
-  	set_curr_insn_source_location (location_from_locus (false_edge->goto_locus));
-#else
-      gcc_unreachable ();
-#endif
+      maybe_dump_rtl_for_gimple_stmt (stmt, last);
+      if (!IS_LOCATION_EMPTY (false_edge->goto_locus))
+  	set_curr_insn_source_location (false_edge->goto_locus);
       true_edge->flags |= EDGE_FALLTHRU;
       return NULL;
     }
@@ -1372,21 +1418,15 @@ expand_gimple_cond_expr (basic_block bb,
     BB_END (new_bb) = PREV_INSN (BB_END (new_bb));
   update_bb_for_insn (new_bb);
 
-  maybe_dump_rtl_for_tree_stmt (stmt, last2);
+  maybe_dump_rtl_for_gimple_stmt (stmt, last2);
 
-  /* FIXME tuples.  */
-#if 0
-  if (false_edge->goto_locus)
-    set_curr_insn_source_location (location_from_locus (false_edge->goto_locus));
-#else
-  gcc_unreachable ();
-#endif
+  if (!IS_LOCATION_EMPTY (false_edge->goto_locus))
+    set_curr_insn_source_location (false_edge->goto_locus);
 
   return new_bb;
 }
-#endif
 
-/* A subroutine of expand_gimple_basic_block.  Expand one CALL_EXPR
+/* A subroutine of expand_gimple_basic_block.  Expand one GIMPLE_CALL
    that has CALL_EXPR_TAILCALL set.  Returns non-null if we actually
    generated a tail call (something that might be denied by the ABI
    rules governing the call; see calls.c).
@@ -1396,26 +1436,25 @@ expand_gimple_cond_expr (basic_block bb,
    where the NaN result goes through the external function (with a
    tailcall) and the normal result happens via a sqrt instruction.  */
 
-/* FIXME tuples.  */
-#if 0
 static basic_block
-expand_gimple_tailcall (basic_block bb, tree stmt, bool *can_fallthru)
+expand_gimple_tailcall (basic_block bb, gimple stmt, bool *can_fallthru)
 {
   rtx last2, last;
   edge e;
   edge_iterator ei;
   int probability;
   gcov_type count;
+  tree stmt_tree = gimple_to_tree (stmt);
 
   last2 = last = get_last_insn ();
 
-  expand_expr_stmt (stmt);
+  expand_expr_stmt (stmt_tree);
 
   for (last = NEXT_INSN (last); last; last = NEXT_INSN (last))
     if (CALL_P (last) && SIBLING_CALL_P (last))
       goto found;
 
-  maybe_dump_rtl_for_tree_stmt (stmt, last2);
+  maybe_dump_rtl_for_gimple_stmt (stmt, last2);
 
   *can_fallthru = true;
   return NULL;
@@ -1490,33 +1529,26 @@ expand_gimple_tailcall (basic_block bb, 
 	BB_END (bb) = PREV_INSN (last);
     }
 
-  maybe_dump_rtl_for_tree_stmt (stmt, last2);
+  maybe_dump_rtl_for_gimple_stmt (stmt, last2);
 
   return bb;
 }
-#endif
 
 /* Expand basic block BB from GIMPLE trees to RTL.  */
 
 static basic_block
 expand_gimple_basic_block (basic_block bb)
 {
-  /* FIXME tuples.  */
-#if 0
-  tree_stmt_iterator tsi;
-  tree stmts = bb_seq (bb);
-  tree stmt = NULL;
+  gimple_stmt_iterator *gsi;
+  gimple stmt = NULL;
   rtx note, last;
   edge e;
   edge_iterator ei;
   void **elt;
 
   if (dump_file)
-    {
-      fprintf (dump_file,
-	       "\n;; Generating RTL for tree basic block %d\n",
-	       bb->index);
-    }
+    fprintf (dump_file, "\n;; Generating RTL for gimple basic block %d\n",
+	     bb->index);
 
   bb->il.gimple = NULL;
   init_rtl_bb_info (bb);
@@ -1524,29 +1556,29 @@ expand_gimple_basic_block (basic_block b
 
   /* Remove the RETURN_EXPR if we may fall though to the exit
      instead.  */
-  tsi = tsi_last (stmts);
-  if (!tsi_end_p (tsi)
-      && TREE_CODE (tsi_stmt (tsi)) == RETURN_EXPR)
+  gsi = gsi_last_bb (bb);
+  if (!gsi_end_p (gsi)
+      && gimple_code (gsi_stmt (gsi)) == GIMPLE_RETURN)
     {
-      tree ret_stmt = tsi_stmt (tsi);
+      gimple ret_stmt = gsi_stmt (gsi);
 
       gcc_assert (single_succ_p (bb));
       gcc_assert (single_succ (bb) == EXIT_BLOCK_PTR);
 
       if (bb->next_bb == EXIT_BLOCK_PTR
-	  && !TREE_OPERAND (ret_stmt, 0))
+	  && !gimple_return_retval (ret_stmt))
 	{
-	  tsi_delink (&tsi);
+	  gsi_remove (gsi, false);
 	  single_succ_edge (bb)->flags |= EDGE_FALLTHRU;
 	}
     }
 
-  tsi = tsi_start (stmts);
-  if (!tsi_end_p (tsi))
+  gsi = gsi_start_bb (bb);
+  if (!gsi_end_p (gsi))
     {
-      stmt = tsi_stmt (tsi);
-      if (TREE_CODE (stmt) != LABEL_EXPR)
-	stmt = NULL_TREE;
+      stmt = gsi_stmt (gsi);
+      if (gimple_code (stmt) != GIMPLE_LABEL)
+	stmt = NULL;
     }
 
   elt = pointer_map_contains (lab_rtx_for_bb, bb);
@@ -1557,8 +1589,10 @@ expand_gimple_basic_block (basic_block b
 
       if (stmt)
 	{
-	  expand_expr_stmt (stmt);
-	  tsi_next (&tsi);
+	  tree stmt_tree = gimple_to_tree (stmt);
+	  expand_expr_stmt (stmt_tree);
+	  ggc_free (stmt_tree);
+	  gsi_next (gsi);
 	}
 
       if (elt)
@@ -1571,7 +1605,7 @@ expand_gimple_basic_block (basic_block b
 	BB_HEAD (bb) = NEXT_INSN (BB_HEAD (bb));
       note = emit_note_after (NOTE_INSN_BASIC_BLOCK, BB_HEAD (bb));
 
-      maybe_dump_rtl_for_tree_stmt (stmt, last);
+      maybe_dump_rtl_for_gimple_stmt (stmt, last);
     }
   else
     note = BB_HEAD (bb) = emit_note (NOTE_INSN_BASIC_BLOCK);
@@ -1592,35 +1626,23 @@ expand_gimple_basic_block (basic_block b
 	ei_next (&ei);
     }
 
-  for (; !tsi_end_p (tsi); tsi_next (&tsi))
+  for (; !gsi_end_p (gsi); gsi_next (gsi))
     {
-      tree stmt = tsi_stmt (tsi);
+      gimple stmt = gsi_stmt (gsi);
       basic_block new_bb;
 
-      if (!stmt)
-	continue;
-
       /* Expand this statement, then evaluate the resulting RTL and
 	 fixup the CFG accordingly.  */
-      if (TREE_CODE (stmt) == COND_EXPR)
+      if (gimple_code (stmt) == GIMPLE_COND)
 	{
-	  new_bb = expand_gimple_cond_expr (bb, stmt);
+	  new_bb = expand_gimple_cond (bb, stmt);
 	  if (new_bb)
 	    return new_bb;
 	}
       else
 	{
-	  tree call = get_call_expr_in (stmt);
-	  int region;
-	  /* For the benefit of calls.c, converting all this to rtl,
-	     we need to record the call expression, not just the outer
-	     modify statement.  */
-	  if (call && call != stmt)
-	    {
-	      if ((region = lookup_stmt_eh_region (stmt)) > 0)
-	        add_stmt_to_eh_region (call, region);
-	      gimple_duplicate_stmt_histograms (cfun, call, cfun, stmt);
-	    }
+	  tree call = gimple_call_fn (stmt);
+
 	  if (call && CALL_EXPR_TAILCALL (call))
 	    {
 	      bool can_fallthru;
@@ -1635,9 +1657,11 @@ expand_gimple_basic_block (basic_block b
 	    }
 	  else
 	    {
+	      tree stmt_tree = gimple_to_tree (stmt);
 	      last = get_last_insn ();
-	      expand_expr_stmt (stmt);
-	      maybe_dump_rtl_for_tree_stmt (stmt, last);
+	      expand_expr_stmt (stmt_tree);
+	      maybe_dump_rtl_for_gimple_stmt (stmt, last);
+	      ggc_free (stmt_tree);
 	    }
 	}
     }
@@ -1652,8 +1676,8 @@ expand_gimple_basic_block (basic_block b
   if (e && e->dest != bb->next_bb)
     {
       emit_jump (label_rtx_for_bb (e->dest));
-      if (e->goto_locus)
-        set_curr_insn_source_location (location_from_locus (e->goto_locus));
+      if (!IS_LOCATION_EMPTY (e->goto_locus))
+        set_curr_insn_source_location (e->goto_locus);
       e->flags &= ~EDGE_FALLTHRU;
     }
 
@@ -1669,9 +1693,6 @@ expand_gimple_basic_block (basic_block b
   BB_END (bb) = last;
 
   update_bb_for_insn (bb);
-#else
-  gcc_unreachable ();
-#endif
 
   return bb;
 }
@@ -1815,8 +1836,6 @@ construct_exit_block (void)
    Look for ARRAY_REF nodes with non-constant indexes and mark them
    addressable.  */
 
-/* FIXME tuples.  */
-#if 0
 static tree
 discover_nonconstant_array_refs_r (tree * tp, int *walk_subtrees,
 				   void *data ATTRIBUTE_UNUSED)
@@ -1854,7 +1873,6 @@ discover_nonconstant_array_refs_r (tree 
 
   return NULL_TREE;
 }
-#endif
 
 /* RTL expansion is not able to compile array references with variable
    offsets for arrays stored in single register.  Discover such
@@ -1864,20 +1882,13 @@ discover_nonconstant_array_refs_r (tree 
 static void
 discover_nonconstant_array_refs (void)
 {
-  /* FIXME tuples.  */
-#if 0
   basic_block bb;
-  block_stmt_iterator bsi;
+  gimple_stmt_iterator *gsi;
 
   FOR_EACH_BB (bb)
-    {
-      for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
-	walk_tree (bsi_stmt_ptr (bsi), discover_nonconstant_array_refs_r,
-		   NULL , NULL);
-    }
-#else
-  gcc_unreachable ();
-#endif
+    for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (gsi))
+      walk_gimple_stmt (gsi_stmt (gsi), NULL, discover_nonconstant_array_refs_r,
+                        NULL);
 }
 
 /* Translate the intermediate representation contained in the CFG
Index: tree-mudflap.c
===================================================================
--- tree-mudflap.c	(revision 130232)
+++ tree-mudflap.c	(working copy)
@@ -1015,6 +1015,7 @@ execute_mudflap_function_decls (void)
 
   push_gimplify_context ();
 
+  /* FIXME tuples.  DECL_SAVED_TREE needs to be changed to gimple_body.  */
   mf_xform_decls (DECL_SAVED_TREE (current_function_decl),
                   DECL_ARGUMENTS (current_function_decl));
 
Index: tree-inline.c
===================================================================
--- tree-inline.c	(revision 130232)
+++ tree-inline.c	(working copy)
@@ -1397,7 +1397,7 @@ copy_generic_body (copy_body_data *id)
   tree body;
   tree fndecl = id->src_fn;
 
-  body = DECL_SAVED_TREE (fndecl);
+  body = gimple_body (fndecl);
   walk_tree (&body, copy_body_r, id, NULL);
 
   return body;
@@ -2053,7 +2053,7 @@ inlinable_function_p (tree fn)
   /* If we don't have the function body available, we can't inline it.
      However, this should not be recorded since we also get here for
      forward declared inline functions.  Therefore, return at once.  */
-  if (!DECL_SAVED_TREE (fn))
+  if (!gimple_body (fn))
     return false;
 
   /* If we're not inlining at all, then we cannot inline this function.  */
@@ -3009,6 +3009,7 @@ clone_body (tree clone, tree fn, void *a
   id.eh_region = -1;
 
   /* Actually copy the body.  */
+  /* FIXME tuples.  DECL_SAVED_TREE needs to be changed to gimple_body.  */
   append_to_statement_list_force (copy_generic_body (&id), &DECL_SAVED_TREE (clone));
 }
 #endif
Index: tree-cfg.c
===================================================================
--- tree-cfg.c	(revision 130232)
+++ tree-cfg.c	(working copy)
@@ -1757,7 +1757,7 @@ remove_useless_stmts_bind (tree *stmt_p,
      optimization again.  */
   block = BIND_EXPR_BLOCK (*stmt_p);
   if (BIND_EXPR_VARS (*stmt_p) == NULL_TREE
-      && *stmt_p != DECL_SAVED_TREE (current_function_decl)
+      && *stmt_p != gimple_body (current_function_decl)
       && (! block
 	  || ! BLOCK_ABSTRACT_ORIGIN (block)
 	  || (TREE_CODE (BLOCK_ABSTRACT_ORIGIN (block))
@@ -1964,7 +1964,7 @@ remove_useless_stmts (void)
   do
     {
       memset (&data, 0, sizeof (data));
-      remove_useless_stmts_1 (&DECL_SAVED_TREE (current_function_decl), &data);
+      remove_useless_stmts_1 (&gimple_body (current_function_decl), &data);
     }
   while (data.repeat);
   return 0;

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