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

PR debug/41371
	* var-tracking.c (find_loc_in_1pdv): Guard asserts with
	ENABLE_CHECKING.
	(intersect_loc_chains): Walk the s2var's loc_chain together
	with s1node chain as long as the locations are equal, don't
	call find_loc_in_1pdv in that case.

From-SVN: r159829
This commit is contained in:
Jakub Jelinek 2010-05-25 18:27:03 +02:00 committed by Jakub Jelinek
parent 6bb0a66a99
commit bb9862c6d9
2 changed files with 38 additions and 0 deletions

View File

@ -1,5 +1,12 @@
2010-05-25 Jakub Jelinek <jakub@redhat.com>
PR debug/41371
* var-tracking.c (find_loc_in_1pdv): Guard asserts with
ENABLE_CHECKING.
(intersect_loc_chains): Walk the s2var's loc_chain together
with s1node chain as long as the locations are equal, don't
call find_loc_in_1pdv in that case.
PR debug/42801
* tree-inline.c (remap_decls): Remap DECL_VALUE_EXPR here...
(copy_bind_expr): ... instead of here.

View File

@ -2490,12 +2490,16 @@ find_loc_in_1pdv (rtx loc, variable var, htab_t vars)
if (!var)
return NULL;
#ifdef ENABLE_CHECKING
gcc_assert (dv_onepart_p (var->dv));
#endif
if (!var->n_var_parts)
return NULL;
#ifdef ENABLE_CHECKING
gcc_assert (var->var_part[0].offset == 0);
#endif
loc_code = GET_CODE (loc);
for (node = var->var_part[0].loc_chain; node; node = node->next)
@ -2590,6 +2594,33 @@ intersect_loc_chains (rtx val, location_chain *dest, struct dfset_merge *dsm,
dataflow_set *s2set = dsm->src;
location_chain found;
if (s2var)
{
location_chain s2node;
#ifdef ENABLE_CHECKING
gcc_assert (dv_onepart_p (s2var->dv));
#endif
if (s2var->n_var_parts)
{
#ifdef ENABLE_CHECKING
gcc_assert (s2var->var_part[0].offset == 0);
#endif
s2node = s2var->var_part[0].loc_chain;
for (; s1node && s2node;
s1node = s1node->next, s2node = s2node->next)
if (s1node->loc != s2node->loc)
break;
else if (s1node->loc == val)
continue;
else
insert_into_intersection (dest, s1node->loc,
MIN (s1node->init, s2node->init));
}
}
for (; s1node; s1node = s1node->next)
{
if (s1node->loc == val)