Commit 0ca9fa56 by Vladimir Makarov Committed by Vladimir Makarov

re PR middle-end/37674 (Bootstrap failure due to miscompilation of genattrtab)

2008-10-15  Vladimir Makarov  <vmakarov@redhat.com>

	PR middle-end/37674
	* ira-build.c (ira_flattening): Recalculate
	ALLOCNO_TOTAL_NO_STACK_REG_P and ALLOCNO_TOTAL_CONFLICT_HARD_REGS
	from the scratch instead of the propagation.

From-SVN: r141159
parent 77d74bc7
2008-10-15 Vladimir Makarov <vmakarov@redhat.com>
PR middle-end/37674
* ira-build.c (ira_flattening): Recalculate
ALLOCNO_TOTAL_NO_STACK_REG_P and ALLOCNO_TOTAL_CONFLICT_HARD_REGS
from the scratch instead of the propagation.
2008-10-15 Richard Sandiford <rdsandiford@googlemail.com> 2008-10-15 Richard Sandiford <rdsandiford@googlemail.com>
* doc/rtl.texi (const_double): Remove the "addr" operand. * doc/rtl.texi (const_double): Remove the "addr" operand.
......
...@@ -2102,7 +2102,7 @@ void ...@@ -2102,7 +2102,7 @@ void
ira_flattening (int max_regno_before_emit, int ira_max_point_before_emit) ira_flattening (int max_regno_before_emit, int ira_max_point_before_emit)
{ {
int i, j, num; int i, j, num;
bool propagate_p, stop_p, keep_p; bool stop_p, keep_p;
int hard_regs_num; int hard_regs_num;
bool new_pseudos_p, merged_p, mem_dest_p; bool new_pseudos_p, merged_p, mem_dest_p;
unsigned int n; unsigned int n;
...@@ -2114,20 +2114,29 @@ ira_flattening (int max_regno_before_emit, int ira_max_point_before_emit) ...@@ -2114,20 +2114,29 @@ ira_flattening (int max_regno_before_emit, int ira_max_point_before_emit)
ira_allocno_iterator ai; ira_allocno_iterator ai;
ira_copy_iterator ci; ira_copy_iterator ci;
sparseset allocnos_live; sparseset allocnos_live;
bool *allocno_propagated_p;
regno_top_level_allocno_map regno_top_level_allocno_map
= (ira_allocno_t *) ira_allocate (max_reg_num () * sizeof (ira_allocno_t)); = (ira_allocno_t *) ira_allocate (max_reg_num () * sizeof (ira_allocno_t));
memset (regno_top_level_allocno_map, 0, memset (regno_top_level_allocno_map, 0,
max_reg_num () * sizeof (ira_allocno_t)); max_reg_num () * sizeof (ira_allocno_t));
allocno_propagated_p
= (bool *) ira_allocate (ira_allocnos_num * sizeof (bool));
memset (allocno_propagated_p, 0, ira_allocnos_num * sizeof (bool));
new_pseudos_p = merged_p = false; new_pseudos_p = merged_p = false;
FOR_EACH_ALLOCNO (a, ai)
{
if (ALLOCNO_CAP_MEMBER (a) != NULL)
/* Caps are not in the regno allocno maps and they are never
will be transformed into allocnos existing after IR
flattening. */
continue;
COPY_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
ALLOCNO_CONFLICT_HARD_REGS (a));
#ifdef STACK_REGS
ALLOCNO_TOTAL_NO_STACK_REG_P (a) = ALLOCNO_NO_STACK_REG_P (a);
#endif
}
/* Fix final allocno attributes. */ /* Fix final allocno attributes. */
for (i = max_regno_before_emit - 1; i >= FIRST_PSEUDO_REGISTER; i--) for (i = max_regno_before_emit - 1; i >= FIRST_PSEUDO_REGISTER; i--)
{ {
mem_dest_p = propagate_p = false; mem_dest_p = false;
for (a = ira_regno_allocno_map[i]; for (a = ira_regno_allocno_map[i];
a != NULL; a != NULL;
a = ALLOCNO_NEXT_REGNO_ALLOCNO (a)) a = ALLOCNO_NEXT_REGNO_ALLOCNO (a))
...@@ -2145,27 +2154,17 @@ ira_flattening (int max_regno_before_emit, int ira_max_point_before_emit) ...@@ -2145,27 +2154,17 @@ ira_flattening (int max_regno_before_emit, int ira_max_point_before_emit)
continue; continue;
} }
ira_assert (ALLOCNO_CAP_MEMBER (parent_a) == NULL); ira_assert (ALLOCNO_CAP_MEMBER (parent_a) == NULL);
if (ALLOCNO_MEM_OPTIMIZED_DEST (a) != NULL) if (ALLOCNO_MEM_OPTIMIZED_DEST (a) != NULL)
mem_dest_p = true; mem_dest_p = true;
if (propagate_p) if (REGNO (ALLOCNO_REG (a)) == REGNO (ALLOCNO_REG (parent_a)))
{ {
if (!allocno_propagated_p [ALLOCNO_NUM (parent_a)])
COPY_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (parent_a),
ALLOCNO_CONFLICT_HARD_REGS (parent_a));
IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (parent_a), IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (parent_a),
ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a)); ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
#ifdef STACK_REGS #ifdef STACK_REGS
if (!allocno_propagated_p [ALLOCNO_NUM (parent_a)]) if (ALLOCNO_TOTAL_NO_STACK_REG_P (a))
ALLOCNO_TOTAL_NO_STACK_REG_P (parent_a) ALLOCNO_TOTAL_NO_STACK_REG_P (parent_a) = true;
= ALLOCNO_NO_STACK_REG_P (parent_a);
ALLOCNO_TOTAL_NO_STACK_REG_P (parent_a)
= (ALLOCNO_TOTAL_NO_STACK_REG_P (parent_a)
|| ALLOCNO_TOTAL_NO_STACK_REG_P (a));
#endif #endif
allocno_propagated_p [ALLOCNO_NUM (parent_a)] = true;
}
if (REGNO (ALLOCNO_REG (a)) == REGNO (ALLOCNO_REG (parent_a)))
{
if (internal_flag_ira_verbose > 4 && ira_dump_file != NULL) if (internal_flag_ira_verbose > 4 && ira_dump_file != NULL)
{ {
fprintf (ira_dump_file, fprintf (ira_dump_file,
...@@ -2188,7 +2187,6 @@ ira_flattening (int max_regno_before_emit, int ira_max_point_before_emit) ...@@ -2188,7 +2187,6 @@ ira_flattening (int max_regno_before_emit, int ira_max_point_before_emit)
continue; continue;
} }
new_pseudos_p = true; new_pseudos_p = true;
propagate_p = true;
first = ALLOCNO_MEM_OPTIMIZED_DEST (a) == NULL ? NULL : a; first = ALLOCNO_MEM_OPTIMIZED_DEST (a) == NULL ? NULL : a;
stop_p = false; stop_p = false;
for (;;) for (;;)
...@@ -2240,7 +2238,6 @@ ira_flattening (int max_regno_before_emit, int ira_max_point_before_emit) ...@@ -2240,7 +2238,6 @@ ira_flattening (int max_regno_before_emit, int ira_max_point_before_emit)
if (mem_dest_p && copy_live_ranges_to_removed_store_destinations (i)) if (mem_dest_p && copy_live_ranges_to_removed_store_destinations (i))
merged_p = true; merged_p = true;
} }
ira_free (allocno_propagated_p);
ira_assert (new_pseudos_p || ira_max_point_before_emit == ira_max_point); ira_assert (new_pseudos_p || ira_max_point_before_emit == ira_max_point);
if (merged_p || ira_max_point_before_emit != ira_max_point) if (merged_p || ira_max_point_before_emit != ira_max_point)
ira_rebuild_start_finish_chains (); ira_rebuild_start_finish_chains ();
......
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