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,18 +190,14 @@ gen_e_list setif_get_inter(gen_e e) ...@@ -190,18 +190,14 @@ 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)
{
assert(! found);
if (sv_eq (v, goal)) if (sv_eq (v, goal))
{ {
found = TRUE; *found = TRUE;
return; return;
} }
else if (sv_lt(v,goal)) else if (sv_lt(v,goal))
...@@ -219,8 +215,8 @@ static setif_var_list search_ubs(region r, setif_var v1, setif_var goal) ...@@ -219,8 +215,8 @@ static setif_var_list search_ubs(region r, setif_var v1, setif_var goal)
{ {
if (setif_is_var(ub)) if (setif_is_var(ub))
{ {
search_ubs_aux((setif_var)ub); search_ubs_aux((setif_var)ub, goal, cycle, found);
if (found) if (*found)
{ {
setif_var_list_cons(v,cycle); setif_var_list_cons(v,cycle);
return; return;
...@@ -228,26 +224,29 @@ static setif_var_list search_ubs(region r, setif_var v1, setif_var goal) ...@@ -228,26 +224,29 @@ static setif_var_list search_ubs(region r, setif_var v1, setif_var goal)
} }
} }
} }
} }
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)
{
bool found;
setif_var_list cycle;
static void search_lbs_aux(setif_var v) static void search_lbs_aux(setif_var v, setif_var goal, setif_var_list cycle,
{ bool* found)
assert (! found); {
assert (! *found);
if (sv_eq(v,goal)) if (sv_eq(v,goal))
{ {
found = TRUE; *found = TRUE;
return; return;
} }
else if (sv_lt(v,goal)) else if (sv_lt(v,goal))
...@@ -265,8 +264,8 @@ static setif_var_list search_lbs(region r, setif_var v1, setif_var goal) ...@@ -265,8 +264,8 @@ static setif_var_list search_lbs(region r, setif_var v1, setif_var goal)
{ {
if (setif_is_var(lb)) if (setif_is_var(lb))
{ {
search_lbs_aux((setif_var)lb); search_lbs_aux((setif_var)lb, goal, cycle, found);
if (found) if (*found)
{ {
setif_var_list_cons(v,cycle); setif_var_list_cons(v,cycle);
return; return;
...@@ -275,15 +274,22 @@ static setif_var_list search_lbs(region r, setif_var v1, setif_var goal) ...@@ -275,15 +274,22 @@ static setif_var_list search_lbs(region r, setif_var v1, setif_var goal)
} }
} }
} }
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,13 +315,12 @@ static setif_var_list cycle_detect_rev(region r, setif_var v1, setif_var v2) ...@@ -309,13 +315,12 @@ 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,
res_proj_fn_ptr res_proj) deletes
{
gen_e lb; gen_e lb;
gen_e_list_scanner scan_bounds; gen_e_list_scanner scan_bounds;
setif_var_list_scanner scan_cycle; setif_var_list_scanner scan_cycle;
...@@ -348,11 +353,13 @@ void setif_inclusion(con_match_fn_ptr con_match, res_proj_fn_ptr res_proj, ...@@ -348,11 +353,13 @@ void setif_inclusion(con_match_fn_ptr con_match, res_proj_fn_ptr res_proj,
setif_stats.cycles_collapsed_backward++; setif_stats.cycles_collapsed_backward++;
setif_stats.cycles_length_backward += setif_var_list_length(cycle); setif_stats.cycles_length_backward += setif_var_list_length(cycle);
} }
static void collapse_cycle_upper(region r, setif_var witness, static void collapse_cycle_upper(region r, setif_var witness,
setif_var_list cycle) deletes setif_var_list cycle,
{ con_match_fn_ptr con_match,
res_proj_fn_ptr res_proj) deletes
{
gen_e ub; gen_e ub;
gen_e_list_scanner scan_bounds; gen_e_list_scanner scan_bounds;
setif_var_list_scanner scan_cycle; setif_var_list_scanner scan_cycle;
...@@ -390,10 +397,12 @@ void setif_inclusion(con_match_fn_ptr con_match, res_proj_fn_ptr res_proj, ...@@ -390,10 +397,12 @@ void setif_inclusion(con_match_fn_ptr con_match, res_proj_fn_ptr res_proj,
setif_stats.cycles_collapsed_forward++; setif_stats.cycles_collapsed_forward++;
setif_stats.cycles_length_backward += setif_var_list_length(cycle); setif_stats.cycles_length_backward += setif_var_list_length(cycle);
} }
static void update_lower_bound(setif_var v, gen_e e) deletes 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 (sv_add_lb(v,e,setif_get_stamp(e)))
{ {
if (setif_is_var(e)) if (setif_is_var(e))
...@@ -425,10 +434,12 @@ void setif_inclusion(con_match_fn_ptr con_match, res_proj_fn_ptr res_proj, ...@@ -425,10 +434,12 @@ void setif_inclusion(con_match_fn_ptr con_match, res_proj_fn_ptr res_proj,
} }
} }
static void update_upper_bound(setif_var v, gen_e e) deletes 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 (sv_add_ub(v,e,setif_get_stamp(e)))
{ {
if (setif_is_var(e)) if (setif_is_var(e))
...@@ -456,9 +467,12 @@ void setif_inclusion(con_match_fn_ptr con_match, res_proj_fn_ptr res_proj, ...@@ -456,9 +467,12 @@ void setif_inclusion(con_match_fn_ptr con_match, res_proj_fn_ptr res_proj,
} }
} }
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