summaryrefslogtreecommitdiff
path: root/gcc/sel-sched.c
diff options
context:
space:
mode:
authoramonakov <amonakov@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-18 12:36:16 +0000
committeramonakov <amonakov@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-18 12:36:16 +0000
commit9b9b82e0e08548e80f9b626686c6930a796c0997 (patch)
treed81160bdc6decd0db9c1c8ba11fe91db4af9dcda /gcc/sel-sched.c
parent6434181f96df843a5974ca2943e12f121dbeb7ec (diff)
downloadgcc-9b9b82e0e08548e80f9b626686c6930a796c0997.tar.gz
PR rtl-optimization/50205
* sel-sched.c (count_occurrences_1): Simplify on the assumption that p->x is a register. Forbid substitution when the same register is found in a different mode. (count_occurrences_equiv): Assert that 'what' is a register. * gcc.dg/pr50205.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180135 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sel-sched.c')
-rw-r--r--gcc/sel-sched.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index f11faca740a..2af01aea99e 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -813,18 +813,12 @@ count_occurrences_1 (rtx *cur_rtx, void *arg)
{
rtx_search_arg_p p = (rtx_search_arg_p) arg;
- /* The last param FOR_GCSE is true, because otherwise it performs excessive
- substitutions like
- r8 = r33
- r16 = r33
- for the last insn it presumes r33 equivalent to r8, so it changes it to
- r33. Actually, there's no change, but it spoils debugging. */
- if (exp_equiv_p (*cur_rtx, p->x, 0, true))
- {
- /* Bail out if we occupy more than one register. */
- if (REG_P (*cur_rtx)
- && HARD_REGISTER_P (*cur_rtx)
- && hard_regno_nregs[REGNO(*cur_rtx)][GET_MODE (*cur_rtx)] > 1)
+ if (REG_P (*cur_rtx) && REGNO (*cur_rtx) == REGNO (p->x))
+ {
+ /* Bail out if mode is different or more than one register is used. */
+ if (GET_MODE (*cur_rtx) != GET_MODE (p->x)
+ || (HARD_REGISTER_P (*cur_rtx)
+ && hard_regno_nregs[REGNO(*cur_rtx)][GET_MODE (*cur_rtx)] > 1))
{
p->n = 0;
return 1;
@@ -837,7 +831,6 @@ count_occurrences_1 (rtx *cur_rtx, void *arg)
}
if (GET_CODE (*cur_rtx) == SUBREG
- && REG_P (p->x)
&& (!REG_P (SUBREG_REG (*cur_rtx))
|| REGNO (SUBREG_REG (*cur_rtx)) == REGNO (p->x)))
{
@@ -859,6 +852,7 @@ count_occurrences_equiv (rtx what, rtx where)
{
struct rtx_search_arg arg;
+ gcc_assert (REG_P (what));
arg.x = what;
arg.n = 0;