http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45652
Alexander Monakov <amonakov at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |amonakov at gcc dot gnu.org
|gnu.org |
--- Comment #9 from Alexander Monakov <amonakov at gcc dot gnu.org> 2010-11-17
15:39:57 UTC ---
(In reply to comment #8)
> > Btw, the scheduler guys have a fix in the works already.
>
> Then they should assign the PR to someone to avoid duplicating efforts.
Sorry. I'm testing the following patch. There's no way to update
REG_BASE_VALUE from sel-sched on the fly, because it affects aliasing for
multiple MEMs (even off the code motion paths), making computed availability
sets inconsistent with new dependencies.
diff --git a/gcc/alias.c b/gcc/alias.c
index 2e0ac06..e79a780 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -1291,6 +1291,12 @@ record_set (rtx dest, const_rtx set, void *data
ATTRIBUTE_UNUSED)
reg_seen[regno] = 1;
}
+rtx
+get_reg_base_value (unsigned int regno)
+{
+ return VEC_index (rtx, reg_base_value, regno);
+}
+
/* If a value is known for REGNO, return it. */
rtx
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 3e1df2c..22721a2 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2508,6 +2508,7 @@ extern rtx find_base_term (rtx);
extern rtx gen_hard_reg_clobber (enum machine_mode, unsigned int);
extern rtx get_reg_known_value (unsigned int);
extern bool get_reg_known_equiv_p (unsigned int);
+extern rtx get_reg_base_value (unsigned int);
#ifdef STACK_REGS
extern int stack_regs_mentioned (const_rtx insn);
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index 70e831d..544348c 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -1139,6 +1139,8 @@ init_regs_for_mode (enum machine_mode mode)
/* Can't use regs which aren't saved by
the prologue. */
|| !TEST_HARD_REG_BIT (sel_hrd.regs_ever_used, cur_reg + i)
+ || get_reg_base_value (cur_reg + i)
#ifdef LEAF_REGISTERS
/* We can't use a non-leaf register if we're in a
leaf function. */