This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: insn-attrtab vs. VM usage
Robert
With your patch the xxx_reaches_here_p routines are now top level
wrappers around the corresponding xxx_reached_here_p_work routines
which do all the real work with any recursion calling the corresponding
xxx_reaches_here_p_work routine.
Now because the xxx_reaches_here_p toplevel wrappers are always called
with the visited parameter NULL this parameter can be removed from the
top level routines parameters and the top level routines changed to
always allocate and free the visited array around the call to the
worker routine..
This for example the pre_expr_reaches_here_p routine would be
/* The wrapper for pre_expr_reaches_here_work that ensures that any
+ memory allocated for that function is returned. */
+
+static int
+pre_expr_reaches_here_p (occr_bb, expr, bb, check_pre_comp, visited)
+ int occr_bb;
+ struct expr *expr;
+ int bb;
+ int check_pre_comp;
+ char *visited;
+{
+ int rval;
+ char * visited = (char *) xcalloc (n_basic_blocks, 1);
+
+ rval = pre_expr_reaches_here_p_work(occr_bb, expr, bb, check_pre_comp,
+ visited);
+
+ free (visited);
+
+ return (rval);
+}
Graham