Commit a57aee2a by Maxim Kuvyrkov Committed by Maxim Kuvyrkov

haifa-sched.c (choose_ready): Fix type of the local variable.

2006-03-23  Maxim Kuvyrkov  <mkuvyrkov@ispras.ru>

	* haifa-sched.c (choose_ready): Fix type of the local variable.
	Move local variables.  Add comment.
	(check_reg_live): Change signature.  Make callable from debugger.
	* sched-int.h (check_reg_live): Update signature.
	* sched-ebb.c (check_reg_live): Update parameters.
	* sched-rgn.c (check_reg_live): Ditto.
	(region_head_or_leaf_p): Check pointer before dereferencing.
	* config/ia64/ia64.c (ia64_set_sched_flags): Disable data speculation
	before reload on optimization levels below 1.

From-SVN: r112328
parent e584065d
2006-03-23 Maxim Kuvyrkov <mkuvyrkov@ispras.ru>
* haifa-sched.c (choose_ready): Fix type of the local variable.
Move local variables. Add comment.
(check_reg_live): Change signature. Make callable from debugger.
* sched-int.h (check_reg_live): Update signature.
* sched-ebb.c (check_reg_live): Update parameters.
* sched-rgn.c (check_reg_live): Ditto.
(region_head_or_leaf_p): Check pointer before dereferencing.
* config/ia64/ia64.c (ia64_set_sched_flags): Disable data speculation
before reload on optimization levels below 1.
2006-03-23 Richard Henderson <rth@redhat.com> 2006-03-23 Richard Henderson <rth@redhat.com>
* config/alpha/alpha.c (alpha_legitimate_constant_p): Reject * config/alpha/alpha.c (alpha_legitimate_constant_p): Reject
......
...@@ -6713,7 +6713,7 @@ ia64_set_sched_flags (spec_info_t spec_info) ...@@ -6713,7 +6713,7 @@ ia64_set_sched_flags (spec_info_t spec_info)
{ {
int mask = 0; int mask = 0;
if ((mflag_sched_br_data_spec && !reload_completed) if ((mflag_sched_br_data_spec && !reload_completed && optimize > 0)
|| (mflag_sched_ar_data_spec && reload_completed)) || (mflag_sched_ar_data_spec && reload_completed))
{ {
mask |= BEGIN_DATA; mask |= BEGIN_DATA;
......
...@@ -2153,11 +2153,11 @@ choose_ready (struct ready_list *ready) ...@@ -2153,11 +2153,11 @@ choose_ready (struct ready_list *ready)
&& spec_info->flags & (PREFER_NON_DATA_SPEC && spec_info->flags & (PREFER_NON_DATA_SPEC
| PREFER_NON_CONTROL_SPEC)) | PREFER_NON_CONTROL_SPEC))
{ {
rtx x;
int s;
for (i = 0, n = ready->n_ready; i < n; i++) for (i = 0, n = ready->n_ready; i < n; i++)
{ {
rtx x;
ds_t s;
x = ready_element (ready, i); x = ready_element (ready, i);
s = TODO_SPEC (x); s = TODO_SPEC (x);
...@@ -2185,6 +2185,8 @@ choose_ready (struct ready_list *ready) ...@@ -2185,6 +2185,8 @@ choose_ready (struct ready_list *ready)
|| (targetm.sched.first_cycle_multipass_dfa_lookahead_guard_spec || (targetm.sched.first_cycle_multipass_dfa_lookahead_guard_spec
&& !targetm.sched.first_cycle_multipass_dfa_lookahead_guard_spec && !targetm.sched.first_cycle_multipass_dfa_lookahead_guard_spec
(insn))) (insn)))
/* Discard speculative instruction that stands first in the ready
list. */
{ {
change_queue_index (insn, 1); change_queue_index (insn, 1);
return 0; return 0;
...@@ -4625,9 +4627,12 @@ check_sched_flags (void) ...@@ -4625,9 +4627,12 @@ check_sched_flags (void)
gcc_assert (f & USE_GLAT); gcc_assert (f & USE_GLAT);
} }
/* Checks global_live_at_{start, end} regsets. */ /* Check global_live_at_{start, end} regsets.
If FATAL_P is TRUE, then abort execution at the first failure.
Overwise, print diagnostics to STDERR (this mode is for calling
from debugger). */
void void
check_reg_live (void) check_reg_live (bool fatal_p)
{ {
basic_block bb; basic_block bb;
...@@ -4638,11 +4643,30 @@ check_reg_live (void) ...@@ -4638,11 +4643,30 @@ check_reg_live (void)
i = bb->index; i = bb->index;
if (glat_start[i]) if (glat_start[i])
gcc_assert (bitmap_equal_p (bb->il.rtl->global_live_at_start, {
glat_start[i])); bool b = bitmap_equal_p (bb->il.rtl->global_live_at_start,
glat_start[i]);
if (!b)
{
gcc_assert (!fatal_p);
fprintf (stderr, ";; check_reg_live_at_start (%d) failed.\n", i);
}
}
if (glat_end[i]) if (glat_end[i])
gcc_assert (bitmap_equal_p (bb->il.rtl->global_live_at_end, {
glat_end[i])); bool b = bitmap_equal_p (bb->il.rtl->global_live_at_end,
glat_end[i]);
if (!b)
{
gcc_assert (!fatal_p);
fprintf (stderr, ";; check_reg_live_at_end (%d) failed.\n", i);
}
}
} }
} }
#endif /* ENABLE_CHECKING */ #endif /* ENABLE_CHECKING */
......
...@@ -667,7 +667,7 @@ schedule_ebbs (void) ...@@ -667,7 +667,7 @@ schedule_ebbs (void)
/* !!! We can't check reg_live_info here because of the fact, /* !!! We can't check reg_live_info here because of the fact,
that destination registers of COND_EXEC's may be dead that destination registers of COND_EXEC's may be dead
before scheduling (while they should be alive). Don't know why. */ before scheduling (while they should be alive). Don't know why. */
/*check_reg_live ();*/ /*check_reg_live (true);*/
#endif #endif
} }
sbitmap_free (large_region_blocks); sbitmap_free (large_region_blocks);
......
...@@ -639,7 +639,7 @@ extern void add_block (basic_block, basic_block); ...@@ -639,7 +639,7 @@ extern void add_block (basic_block, basic_block);
extern void attach_life_info (void); extern void attach_life_info (void);
#ifdef ENABLE_CHECKING #ifdef ENABLE_CHECKING
extern void check_reg_live (void); extern void check_reg_live (bool);
#endif #endif
#endif /* GCC_SCHED_INT_H */ #endif /* GCC_SCHED_INT_H */
...@@ -3020,7 +3020,7 @@ schedule_insns (void) ...@@ -3020,7 +3020,7 @@ schedule_insns (void)
: (PROP_DEATH_NOTES | PROP_REG_INFO))); : (PROP_DEATH_NOTES | PROP_REG_INFO)));
#ifdef ENABLE_CHECKING #ifdef ENABLE_CHECKING
check_reg_live (); check_reg_live (true);
#endif #endif
} }
...@@ -3266,7 +3266,8 @@ region_head_or_leaf_p (basic_block bb, int leaf_p) ...@@ -3266,7 +3266,8 @@ region_head_or_leaf_p (basic_block bb, int leaf_p)
i = CONTAINING_RGN (bb->index); i = CONTAINING_RGN (bb->index);
FOR_EACH_EDGE (e, ei, bb->succs) FOR_EACH_EDGE (e, ei, bb->succs)
if (CONTAINING_RGN (e->dest->index) == i if (e->dest != EXIT_BLOCK_PTR
&& CONTAINING_RGN (e->dest->index) == i
/* except self-loop. */ /* except self-loop. */
&& e->dest != bb) && e->dest != bb)
return 0; return 0;
......
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