Commit 9e73c690 by Jakub Jelinek Committed by Jakub Jelinek

re PR debug/41371 (var-tracking is slow and memory hungry)

	PR debug/41371
	* var-tracking.c (values_to_unmark): New variable.
	(find_loc_in_1pdv): Clear VALUE_RECURSED_INTO of values in
	values_to_unmark vector.  Moved body to...
	(find_loc_in_1pdv_1): ... this.  Don't clear VALUE_RECURSED_INTO,
	instead queue it into values_to_unmark vector.
	(vt_find_locations): Free values_to_unmark vector.

From-SVN: r155858
parent dc2f28c5
2010-01-13 Jakub Jelinek <jakub@redhat.com>
PR debug/41371
* var-tracking.c (values_to_unmark): New variable.
(find_loc_in_1pdv): Clear VALUE_RECURSED_INTO of values in
values_to_unmark vector. Moved body to...
(find_loc_in_1pdv_1): ... this. Don't clear VALUE_RECURSED_INTO,
instead queue it into values_to_unmark vector.
(vt_find_locations): Free values_to_unmark vector.
2010-01-13 Wolfgang Gellerich <gellerich@de.ibm.com> 2010-01-13 Wolfgang Gellerich <gellerich@de.ibm.com>
* config/s390/s390.c (override_options): Set * config/s390/s390.c (override_options): Set
......
/* Variable tracking routines for the GNU compiler. /* Variable tracking routines for the GNU compiler.
Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009 Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -2252,12 +2252,18 @@ dv_changed_p (decl_or_value dv) ...@@ -2252,12 +2252,18 @@ dv_changed_p (decl_or_value dv)
: DECL_CHANGED (dv_as_decl (dv))); : DECL_CHANGED (dv_as_decl (dv)));
} }
/* Return a location list node whose loc is rtx_equal to LOC, in the /* Vector of VALUEs that should have VALUE_RECURSED_INTO bit cleared
at the end of find_loc_in_1pdv. Not a static variable in find_loc_in_1pdv
to avoid constant allocation/freeing of it. */
static VEC(rtx, heap) *values_to_unmark;
/* Helper function for find_loc_in_1pdv.
Return a location list node whose loc is rtx_equal to LOC, in the
location list of a one-part variable or value VAR, or in that of location list of a one-part variable or value VAR, or in that of
any values recursively mentioned in the location lists. */ any values recursively mentioned in the location lists. */
static location_chain static location_chain
find_loc_in_1pdv (rtx loc, variable var, htab_t vars) find_loc_in_1pdv_1 (rtx loc, variable var, htab_t vars)
{ {
location_chain node; location_chain node;
...@@ -2285,18 +2291,33 @@ find_loc_in_1pdv (rtx loc, variable var, htab_t vars) ...@@ -2285,18 +2291,33 @@ find_loc_in_1pdv (rtx loc, variable var, htab_t vars)
{ {
location_chain where; location_chain where;
VALUE_RECURSED_INTO (node->loc) = true; VALUE_RECURSED_INTO (node->loc) = true;
if ((where = find_loc_in_1pdv (loc, var, vars))) VEC_safe_push (rtx, heap, values_to_unmark, node->loc);
{ if ((where = find_loc_in_1pdv_1 (loc, var, vars)))
VALUE_RECURSED_INTO (node->loc) = false; return where;
return where;
}
VALUE_RECURSED_INTO (node->loc) = false;
} }
} }
return NULL; return NULL;
} }
/* Return a location list node whose loc is rtx_equal to LOC, in the
location list of a one-part variable or value VAR, or in that of
any values recursively mentioned in the location lists. */
static location_chain
find_loc_in_1pdv (rtx loc, variable var, htab_t vars)
{
location_chain ret;
unsigned int i;
rtx value;
ret = find_loc_in_1pdv_1 (loc, var, vars);
for (i = 0; VEC_iterate (rtx, values_to_unmark, i, value); i++)
VALUE_RECURSED_INTO (value) = false;
VEC_truncate (rtx, values_to_unmark, 0);
return ret;
}
/* Hash table iteration argument passed to variable_merge. */ /* Hash table iteration argument passed to variable_merge. */
struct dfset_merge struct dfset_merge
{ {
...@@ -5648,6 +5669,7 @@ vt_find_locations (void) ...@@ -5648,6 +5669,7 @@ vt_find_locations (void)
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
gcc_assert (VTI (bb)->flooded); gcc_assert (VTI (bb)->flooded);
VEC_free (rtx, heap, values_to_unmark);
free (bb_order); free (bb_order);
fibheap_delete (worklist); fibheap_delete (worklist);
fibheap_delete (pending); fibheap_delete (pending);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment