summaryrefslogtreecommitdiff
path: root/gcc/sel-sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/sel-sched.c')
-rw-r--r--gcc/sel-sched.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index 1e3fcf0da5a..ad4a0aa5020 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -1,5 +1,5 @@
/* Instruction scheduling pass. Selective scheduler and pipeliner.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+ Copyright (C) 2006-2014 Free Software Foundation, Inc.
This file is part of GCC.
@@ -1253,7 +1253,7 @@ mark_unavailable_hard_regs (def_t def, struct reg_rename *reg_rename_p,
if (!HARD_FRAME_POINTER_IS_FRAME_POINTER)
add_to_hard_reg_set (&reg_rename_p->unavailable_hard_regs,
- Pmode, HARD_FRAME_POINTER_IS_FRAME_POINTER);
+ Pmode, HARD_FRAME_POINTER_REGNUM);
}
#ifdef STACK_REGS
@@ -3801,6 +3801,7 @@ fill_vec_av_set (av_set_t av, blist_t bnds, fence_t fence,
signed char target_available;
bool is_orig_reg_p = true;
int need_cycles, new_prio;
+ bool fence_insn_p = INSN_UID (insn) == INSN_UID (FENCE_INSN (fence));
/* Don't allow any insns other than from SCHED_GROUP if we have one. */
if (FENCE_SCHED_NEXT (fence) && insn != FENCE_SCHED_NEXT (fence))
@@ -3855,9 +3856,16 @@ fill_vec_av_set (av_set_t av, blist_t bnds, fence_t fence,
if (sched_verbose >= 4)
sel_print ("Expr %d has no suitable target register\n",
INSN_UID (insn));
- continue;
+
+ /* A fence insn should not get here. */
+ gcc_assert (!fence_insn_p);
+ continue;
}
+ /* At this point a fence insn should always be available. */
+ gcc_assert (!fence_insn_p
+ || INSN_UID (FENCE_INSN (fence)) == INSN_UID (EXPR_INSN_RTX (expr)));
+
/* Filter expressions that need to be renamed or speculated when
pipelining, because compensating register copies or speculation
checks are likely to be placed near the beginning of the loop,
@@ -4663,8 +4671,8 @@ create_block_for_bookkeeping (edge e1, edge e2)
new_bb->index = succ->index;
succ->index = i;
- SET_BASIC_BLOCK (new_bb->index, new_bb);
- SET_BASIC_BLOCK (succ->index, succ);
+ SET_BASIC_BLOCK_FOR_FN (cfun, new_bb->index, new_bb);
+ SET_BASIC_BLOCK_FOR_FN (cfun, succ->index, succ);
memcpy (&gbi, SEL_GLOBAL_BB_INFO (new_bb), sizeof (gbi));
memcpy (SEL_GLOBAL_BB_INFO (new_bb), SEL_GLOBAL_BB_INFO (succ),
@@ -4903,7 +4911,8 @@ remove_insns_that_need_bookkeeping (fence_t fence, av_set_t *av_ptr)
&& (EXPR_SPEC (expr)
|| !EXPR_ORIG_BB_INDEX (expr)
|| !dominated_by_p (CDI_DOMINATORS,
- BASIC_BLOCK (EXPR_ORIG_BB_INDEX (expr)),
+ BASIC_BLOCK_FOR_FN (cfun,
+ EXPR_ORIG_BB_INDEX (expr)),
BLOCK_FOR_INSN (FENCE_INSN (fence)))))
{
if (sched_verbose >= 4)
@@ -6886,7 +6895,7 @@ current_region_empty_p (void)
{
int i;
for (i = 0; i < current_nr_blocks; i++)
- if (! sel_bb_empty_p (BASIC_BLOCK (BB_TO_BLOCK (i))))
+ if (! sel_bb_empty_p (BASIC_BLOCK_FOR_FN (cfun, BB_TO_BLOCK (i))))
return false;
return true;
@@ -6945,7 +6954,7 @@ sel_region_init (int rgn)
bbs.create (current_nr_blocks);
for (i = 0; i < current_nr_blocks; i++)
- bbs.quick_push (BASIC_BLOCK (BB_TO_BLOCK (i)));
+ bbs.quick_push (BASIC_BLOCK_FOR_FN (cfun, BB_TO_BLOCK (i)));
sel_init_bbs (bbs);
@@ -6980,13 +6989,14 @@ sel_region_init (int rgn)
compute_live for the first insn of the loop. */
if (current_loop_nest)
{
- int header = (sel_is_loop_preheader_p (BASIC_BLOCK (BB_TO_BLOCK (0)))
- ? 1
- : 0);
+ int header =
+ (sel_is_loop_preheader_p (BASIC_BLOCK_FOR_FN (cfun, BB_TO_BLOCK (0)))
+ ? 1
+ : 0);
if (current_nr_blocks == header + 1)
update_liveness_on_insn
- (sel_bb_head (BASIC_BLOCK (BB_TO_BLOCK (header))));
+ (sel_bb_head (BASIC_BLOCK_FOR_FN (cfun, BB_TO_BLOCK (header))));
}
/* Set hooks so that no newly generated insn will go out unnoticed. */
@@ -7024,7 +7034,7 @@ simplify_changed_insns (void)
for (i = 0; i < current_nr_blocks; i++)
{
- basic_block bb = BASIC_BLOCK (BB_TO_BLOCK (i));
+ basic_block bb = BASIC_BLOCK_FOR_FN (cfun, BB_TO_BLOCK (i));
rtx insn;
FOR_BB_INSNS (bb, insn)