Commit 093ff71e by Giovanni Bajo

re PR bootstrap/15627 (Sun CC cannot bootstrap GCC)

	PR bootstrap/15627
	* engine/flowrow-sort.c (update_upper_bound): Converted comment to
	C-style.
	(flowrow_inclusion): Likewise.
	(flowrow_extract_field): Unnest field_eq.
	* engine/setif-sort.c (search_ubs): Unnest search_ubs_aux.
	(search_lbs): Unnest search_lbs_aux.
	(setif_inclusion): Unnest collapse_cycle_lower, collapse_cycle_upper,
	update_lower_bound, update_upper_bound.

From-SVN: r83730
parent 3c01e5df
2004-06-27 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR bootstrap/15627
* engine/flowrow-sort.c (update_upper_bound): Converted comment to
C-style.
(flowrow_inclusion): Likewise.
(flowrow_extract_field): Unnest field_eq.
* engine/setif-sort.c (search_ubs): Unnest search_ubs_aux.
(search_lbs): Unnest search_lbs_aux.
(setif_inclusion): Unnest collapse_cycle_lower, collapse_cycle_upper,
update_lower_bound, update_upper_bound.
2004-06-15 Paolo Bonzini <bonzini@gnu.org> 2004-06-15 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in: Regenerate with automake 1.8.5. * Makefile.in: Regenerate with automake 1.8.5.
......
...@@ -483,7 +483,7 @@ static void update_upper_bound(fresh_fn_ptr fresh,get_stamp_fn_ptr get_stamp, ...@@ -483,7 +483,7 @@ static void update_upper_bound(fresh_fn_ptr fresh,get_stamp_fn_ptr get_stamp,
{ {
flow_var v2 = (flow_var)e; flow_var v2 = (flow_var)e;
if (fv_has_contour(v2)) // v2 isn't aliased, and we discovered a contour if (fv_has_contour(v2)) /* v2 isn't aliased, and we discovered a contour */
{ {
gen_e shape = fv_instantiate_contour(v2); gen_e shape = fv_instantiate_contour(v2);
...@@ -532,7 +532,7 @@ static void update_upper_bound(fresh_fn_ptr fresh,get_stamp_fn_ptr get_stamp, ...@@ -532,7 +532,7 @@ static void update_upper_bound(fresh_fn_ptr fresh,get_stamp_fn_ptr get_stamp,
} }
// END /* END */
void flowrow_inclusion(fresh_fn_ptr fresh,get_stamp_fn_ptr get_stamp, void flowrow_inclusion(fresh_fn_ptr fresh,get_stamp_fn_ptr get_stamp,
...@@ -604,7 +604,7 @@ void flowrow_inclusion(fresh_fn_ptr fresh,get_stamp_fn_ptr get_stamp, ...@@ -604,7 +604,7 @@ void flowrow_inclusion(fresh_fn_ptr fresh,get_stamp_fn_ptr get_stamp,
gen_e rest1 = flowrow_get_rest(e1), gen_e rest1 = flowrow_get_rest(e1),
rest2 = flowrow_get_rest(e2); rest2 = flowrow_get_rest(e2);
//assert( flowrow_is_var(rest1) && flowrow_is_var(rest2)); /*assert( flowrow_is_var(rest1) && flowrow_is_var(rest2));*/
if ( eq(rest1,rest2)) if ( eq(rest1,rest2))
failure("Recursive row resolution\n"); failure("Recursive row resolution\n");
...@@ -919,19 +919,21 @@ sort_kind flowrow_base_sort(gen_e e) ...@@ -919,19 +919,21 @@ sort_kind flowrow_base_sort(gen_e e)
} }
#endif /* NONSPEC */ #endif /* NONSPEC */
static const char* field_eq_name;
static bool field_eq(const flowrow_field f)
{
return (! strcmp(f->label,field_eq_name));
}
gen_e flowrow_extract_field(const char *name, gen_e e) gen_e flowrow_extract_field(const char *name, gen_e e)
{ {
static bool field_eq(const flowrow_field f)
{
return (! strcmp(f->label,name));
}
if (flowrow_is_row(e)) if (flowrow_is_row(e))
{ {
flowrow_map fields = flowrow_get_fields(e); flowrow_map fields = flowrow_get_fields(e);
flowrow_field f = flowrow_map_find(fields,field_eq); flowrow_field f;
field_eq_name = name;
f = flowrow_map_find(fields,field_eq);
if (f) if (f)
return f->expr; return f->expr;
......
...@@ -190,100 +190,106 @@ gen_e_list setif_get_inter(gen_e e) ...@@ -190,100 +190,106 @@ gen_e_list setif_get_inter(gen_e e)
return ( (setif_inter_) e)->exprs; return ( (setif_inter_) e)->exprs;
} }
static setif_var_list search_ubs(region r, setif_var v1, setif_var goal) static void search_ubs_aux(setif_var v, setif_var goal, setif_var_list cycle,
bool* found)
{ {
bool found = FALSE; assert(! *found);
setif_var_list cycle;
static void search_ubs_aux(setif_var v) if (sv_eq (v, goal))
{
*found = TRUE;
return;
}
else if (sv_lt(v,goal))
{ {
assert(! found); return;
}
else
{
gen_e_list_scanner scan;
gen_e ub;
gen_e_list ubs = sv_get_ubs(v);
if (sv_eq (v, goal)) gen_e_list_scan(ubs,&scan);
{ while (gen_e_list_next(&scan,&ub))
found = TRUE; {
return; if (setif_is_var(ub))
}
else if (sv_lt(v,goal))
{
return;
}
else
{
gen_e_list_scanner scan;
gen_e ub;
gen_e_list ubs = sv_get_ubs(v);
gen_e_list_scan(ubs,&scan);
while (gen_e_list_next(&scan,&ub))
{ {
if (setif_is_var(ub)) search_ubs_aux((setif_var)ub, goal, cycle, found);
if (*found)
{ {
search_ubs_aux((setif_var)ub); setif_var_list_cons(v,cycle);
if (found) return;
{
setif_var_list_cons(v,cycle);
return;
}
} }
} }
} }
} }
}
static setif_var_list search_ubs(region r, setif_var v1, setif_var goal)
{
bool found;
setif_var_list cycle;
found = FALSE; found = FALSE;
cycle = new_setif_var_list(r); cycle = new_setif_var_list(r);
search_ubs_aux(v1); search_ubs_aux(v1, goal, cycle, &found);
return cycle; return cycle;
} }
static setif_var_list search_lbs(region r, setif_var v1, setif_var goal)
static void search_lbs_aux(setif_var v, setif_var goal, setif_var_list cycle,
bool* found)
{ {
bool found; assert (! *found);
setif_var_list cycle; if (sv_eq(v,goal))
static void search_lbs_aux(setif_var v)
{ {
assert (! found); *found = TRUE;
if (sv_eq(v,goal)) return;
{ }
found = TRUE; else if (sv_lt(v,goal))
return; {
} return;
else if (sv_lt(v,goal)) }
{ else
return; {
} gen_e_list_scanner scan;
else gen_e lb;
{ gen_e_list lbs = sv_get_lbs(v);
gen_e_list_scanner scan;
gen_e lb; gen_e_list_scan(lbs,&scan);
gen_e_list lbs = sv_get_lbs(v); while (gen_e_list_next(&scan,&lb))
{
gen_e_list_scan(lbs,&scan); if (setif_is_var(lb))
while (gen_e_list_next(&scan,&lb))
{ {
if (setif_is_var(lb)) search_lbs_aux((setif_var)lb, goal, cycle, found);
if (*found)
{ {
search_lbs_aux((setif_var)lb); setif_var_list_cons(v,cycle);
if (found) return;
{
setif_var_list_cons(v,cycle);
return;
}
} }
} }
} }
} }
}
static setif_var_list search_lbs(region r, setif_var v1, setif_var goal)
{
bool found;
setif_var_list cycle;
found = FALSE; found = FALSE;
cycle = new_setif_var_list(r); cycle = new_setif_var_list(r);
search_lbs_aux(v1); search_lbs_aux(v1, goal, cycle, &found);
return cycle; return cycle;
} }
static setif_var_list cycle_detect(region r,setif_var v1,setif_var v2) static setif_var_list cycle_detect(region r,setif_var v1,setif_var v2)
{ {
if (sv_union_component(v1,v2)) if (sv_union_component(v1,v2))
...@@ -309,156 +315,164 @@ static setif_var_list cycle_detect_rev(region r, setif_var v1, setif_var v2) ...@@ -309,156 +315,164 @@ static setif_var_list cycle_detect_rev(region r, setif_var v1, setif_var v2)
} }
} }
void setif_inclusion(con_match_fn_ptr con_match, res_proj_fn_ptr res_proj,
gen_e e1, gen_e e2) deletes
{
static void collapse_cycle_lower(region r, setif_var witness, static void collapse_cycle_lower(region r, setif_var witness,
setif_var_list cycle) deletes setif_var_list cycle,
{ con_match_fn_ptr con_match,
gen_e lb; res_proj_fn_ptr res_proj) deletes
gen_e_list_scanner scan_bounds; {
setif_var_list_scanner scan_cycle; gen_e lb;
setif_var var; gen_e_list_scanner scan_bounds;
setif_var_list_scanner scan_cycle;
setif_var var;
#ifndef NDEBUG #ifndef NDEBUG
stamp lowest = sv_get_stamp(witness); stamp lowest = sv_get_stamp(witness);
#endif #endif
bounds b = bounds_create(r); bounds b = bounds_create(r);
/* Collect all lower bounds in the cycle, and add transitive edges */
setif_var_list_scan(cycle,&scan_cycle);
while(setif_var_list_next(&scan_cycle,&var))
{
assert( sv_get_stamp(var) > lowest);
gen_e_list_scan(sv_get_lbs(var),&scan_bounds);
while(gen_e_list_next(&scan_bounds,&lb))
bounds_add(b,lb,setif_get_stamp(lb));
}
sv_unify(witness,cycle);
assert(sv_get_stamp(witness) == lowest);
gen_e_list_scan(bounds_exprs(b),&scan_bounds);
while (gen_e_list_next(&scan_bounds,&lb))
setif_inclusion(con_match,res_proj,lb, (gen_e) witness);
bounds_delete(b);
invalidate_tlb_cache();
setif_stats.cycles_collapsed_backward++;
setif_stats.cycles_length_backward += setif_var_list_length(cycle);
}
static void collapse_cycle_upper(region r, setif_var witness, /* Collect all lower bounds in the cycle, and add transitive edges */
setif_var_list cycle) deletes setif_var_list_scan(cycle,&scan_cycle);
while(setif_var_list_next(&scan_cycle,&var))
{ {
gen_e ub; assert( sv_get_stamp(var) > lowest);
gen_e_list_scanner scan_bounds; gen_e_list_scan(sv_get_lbs(var),&scan_bounds);
setif_var_list_scanner scan_cycle; while(gen_e_list_next(&scan_bounds,&lb))
setif_var var; bounds_add(b,lb,setif_get_stamp(lb));
}
#ifndef NDEBUG sv_unify(witness,cycle);
stamp lowest = sv_get_stamp(witness); assert(sv_get_stamp(witness) == lowest);
#endif
bounds b = bounds_create(r); gen_e_list_scan(bounds_exprs(b),&scan_bounds);
while (gen_e_list_next(&scan_bounds,&lb))
/* Collect all upper bounds in the cycle, and add transitive edges */ setif_inclusion(con_match,res_proj,lb, (gen_e) witness);
setif_var_list_scan(cycle,&scan_cycle);
while(setif_var_list_next(&scan_cycle,&var)) bounds_delete(b);
{ invalidate_tlb_cache();
assert( sv_get_stamp(var) > lowest);
gen_e_list_scan(sv_get_ubs(var),&scan_bounds);
while(gen_e_list_next(&scan_bounds,&ub))
bounds_add(b,ub,setif_get_stamp(ub));
gen_e_list_scan(sv_get_ub_projs(var),&scan_bounds);
while(gen_e_list_next(&scan_bounds,&ub))
bounds_add(b,ub,setif_get_stamp(ub));
}
sv_unify(witness,cycle); setif_stats.cycles_collapsed_backward++;
assert(sv_get_stamp(witness) == lowest); setif_stats.cycles_length_backward += setif_var_list_length(cycle);
}
gen_e_list_scan(bounds_exprs(b),&scan_bounds); static void collapse_cycle_upper(region r, setif_var witness,
while (gen_e_list_next(&scan_bounds,&ub)) setif_var_list cycle,
setif_inclusion(con_match,res_proj,(gen_e) witness, ub); con_match_fn_ptr con_match,
res_proj_fn_ptr res_proj) deletes
bounds_delete(b); {
invalidate_tlb_cache(); gen_e ub;
gen_e_list_scanner scan_bounds;
setif_var_list_scanner scan_cycle;
setif_var var;
setif_stats.cycles_collapsed_forward++; #ifndef NDEBUG
setif_stats.cycles_length_backward += setif_var_list_length(cycle); stamp lowest = sv_get_stamp(witness);
} #endif
bounds b = bounds_create(r);
static void update_lower_bound(setif_var v, gen_e e) deletes /* Collect all upper bounds in the cycle, and add transitive edges */
{ setif_var_list_scan(cycle,&scan_cycle);
if (sv_add_lb(v,e,setif_get_stamp(e))) while(setif_var_list_next(&scan_cycle,&var))
{ {
if (setif_is_var(e)) assert( sv_get_stamp(var) > lowest);
setif_stats.redundant_succ++;
gen_e_list_scan(sv_get_ubs(var),&scan_bounds);
else while(gen_e_list_next(&scan_bounds,&ub))
setif_stats.redundant_source++; bounds_add(b,ub,setif_get_stamp(ub));
}
gen_e_list_scan(sv_get_ub_projs(var),&scan_bounds);
while(gen_e_list_next(&scan_bounds,&ub))
bounds_add(b,ub,setif_get_stamp(ub));
}
else sv_unify(witness,cycle);
{ assert(sv_get_stamp(witness) == lowest);
gen_e_list_scanner scan;
gen_e ub;
if (setif_is_var(e))
setif_stats.added_succ++;
else
setif_stats.added_source++;
invalidate_tlb_cache();
gen_e_list_scan(sv_get_ubs(v),&scan); gen_e_list_scan(bounds_exprs(b),&scan_bounds);
while(gen_e_list_next(&scan,&ub)) while (gen_e_list_next(&scan_bounds,&ub))
setif_inclusion(con_match,res_proj,e,ub); setif_inclusion(con_match,res_proj,(gen_e) witness, ub);
gen_e_list_scan(sv_get_ub_projs(v),&scan); bounds_delete(b);
while (gen_e_list_next(&scan,&ub)) invalidate_tlb_cache();
setif_inclusion(con_match,res_proj,e,ub);
} setif_stats.cycles_collapsed_forward++;
setif_stats.cycles_length_backward += setif_var_list_length(cycle);
}
static void update_lower_bound(setif_var v, gen_e e,
con_match_fn_ptr con_match,
res_proj_fn_ptr res_proj) deletes
{
if (sv_add_lb(v,e,setif_get_stamp(e)))
{
if (setif_is_var(e))
setif_stats.redundant_succ++;
else
setif_stats.redundant_source++;
} }
static void update_upper_bound(setif_var v, gen_e e) deletes else
{ {
if (sv_add_ub(v,e,setif_get_stamp(e))) gen_e_list_scanner scan;
{ gen_e ub;
if (setif_is_var(e))
setif_stats.redundant_pred++;
else
setif_stats.redundant_sink++;
}
if (setif_is_var(e))
setif_stats.added_succ++;
else else
{ setif_stats.added_source++;
gen_e_list_scanner scan;
gen_e lb; invalidate_tlb_cache();
if (setif_is_var(e)) gen_e_list_scan(sv_get_ubs(v),&scan);
setif_stats.added_pred++; while(gen_e_list_next(&scan,&ub))
else setif_inclusion(con_match,res_proj,e,ub);
setif_stats.added_sink++;
gen_e_list_scan(sv_get_ub_projs(v),&scan);
while (gen_e_list_next(&scan,&ub))
setif_inclusion(con_match,res_proj,e,ub);
invalidate_tlb_cache(); }
gen_e_list_scan(sv_get_lbs(v),&scan); }
while (gen_e_list_next(&scan,&lb))
setif_inclusion(con_match,res_proj,lb,e);
} static void update_upper_bound(setif_var v, gen_e e,
con_match_fn_ptr con_match,
res_proj_fn_ptr res_proj) deletes
{
if (sv_add_ub(v,e,setif_get_stamp(e)))
{
if (setif_is_var(e))
setif_stats.redundant_pred++;
else
setif_stats.redundant_sink++;
}
else
{
gen_e_list_scanner scan;
gen_e lb;
if (setif_is_var(e))
setif_stats.added_pred++;
else
setif_stats.added_sink++;
invalidate_tlb_cache();
gen_e_list_scan(sv_get_lbs(v),&scan);
while (gen_e_list_next(&scan,&lb))
setif_inclusion(con_match,res_proj,lb,e);
} }
}
void setif_inclusion(con_match_fn_ptr con_match, res_proj_fn_ptr res_proj,
gen_e e1, gen_e e2) deletes
{
if (eq(e1,e2)) if (eq(e1,e2))
return; return;
...@@ -519,18 +533,18 @@ void setif_inclusion(con_match_fn_ptr con_match, res_proj_fn_ptr res_proj, ...@@ -519,18 +533,18 @@ void setif_inclusion(con_match_fn_ptr con_match, res_proj_fn_ptr res_proj,
setif_var_list cycle = cycle_detect(scratch,v1,v2); setif_var_list cycle = cycle_detect(scratch,v1,v2);
if (! setif_var_list_empty(cycle)) if (! setif_var_list_empty(cycle))
collapse_cycle_upper(scratch,v1,cycle); collapse_cycle_upper(scratch,v1,cycle,con_match,res_proj);
else else
update_lower_bound(v2,e1); update_lower_bound(v2,e1,con_match,res_proj);
deleteregion(scratch); deleteregion(scratch);
} }
else else
update_lower_bound(v2,e1); update_lower_bound(v2,e1,con_match,res_proj);
} }
else /* e1 is a source */ else /* e1 is a source */
update_lower_bound(v2,e1); update_lower_bound(v2,e1,con_match,res_proj);
} }
else if ( r_inductive(e1,e2) ) /* 'x <= _ */ else if ( r_inductive(e1,e2) ) /* 'x <= _ */
...@@ -547,22 +561,22 @@ void setif_inclusion(con_match_fn_ptr con_match, res_proj_fn_ptr res_proj, ...@@ -547,22 +561,22 @@ void setif_inclusion(con_match_fn_ptr con_match, res_proj_fn_ptr res_proj,
setif_var_list cycle = cycle_detect_rev(scratch,v1,v2); setif_var_list cycle = cycle_detect_rev(scratch,v1,v2);
if (! setif_var_list_empty(cycle)) if (! setif_var_list_empty(cycle))
collapse_cycle_lower(scratch,v2,cycle); collapse_cycle_lower(scratch,v2,cycle,con_match,res_proj);
else else
update_upper_bound(v1,e2); update_upper_bound(v1,e2,con_match,res_proj);
deleteregion(scratch); deleteregion(scratch);
} }
else else
update_upper_bound(v1,e2); update_upper_bound(v1,e2,con_match,res_proj);
} }
else /* e2 is a sink */ else /* e2 is a sink */
{ {
if (flag_merge_projections && res_proj(v1,e2)) if (flag_merge_projections && res_proj(v1,e2))
return; return;
else else
update_upper_bound(v1,e2); update_upper_bound(v1,e2,con_match,res_proj);
} }
} }
......
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