Commit 579c1bf3 by Bernd Schmidt Committed by Bernd Schmidt

re PR bootstrap/45445 (ARM bootstrap failure: comparison failures after stage 3)

	PR bootstrap/45445
	* ira-lives.c (mark_pseudo_reg_live, mark_pseudo_reg_dead): New
	static functions.
	(mark_ref_live, mark_ref_dead): Use them.
	(make_pseudo_conflict): New arg ORIG_DREG.  All callers changed.
	Save the original reg, and use the new functions.
	(check_and_make_def_use_conflict): New arg ORIG_DREG.  All callers
	changed.
	(check_and_make_def_conflict): Save the original reg.

From-SVN: r165329
parent 30aeeca4
2010-10-11 Bernd Schmidt <bernds@codesourcery.com>
PR bootstrap/45445
* ira-lives.c (mark_pseudo_reg_live, mark_pseudo_reg_dead): New
static functions.
(mark_ref_live, mark_ref_dead): Use them.
(make_pseudo_conflict): New arg ORIG_DREG. All callers changed.
Save the original reg, and use the new functions.
(check_and_make_def_use_conflict): New arg ORIG_DREG. All callers
changed.
(check_and_make_def_conflict): Save the original reg.
2010-10-11 Martin Jambor <mjambor@suse.cz> 2010-10-11 Martin Jambor <mjambor@suse.cz>
PR middle-end/45699 PR middle-end/45699
...@@ -329,6 +329,21 @@ mark_hard_reg_live (rtx reg) ...@@ -329,6 +329,21 @@ mark_hard_reg_live (rtx reg)
} }
} }
/* Mark a pseudo, or one of its subwords, as live. REGNO is the pseudo's
register number; ORIG_REG is the access in the insn, which may be a
subreg. */
static void
mark_pseudo_reg_live (rtx orig_reg, unsigned regno)
{
if (df_read_modify_subreg_p (orig_reg))
{
mark_pseudo_regno_subword_live (regno,
subreg_lowpart_p (orig_reg) ? 0 : 1);
}
else
mark_pseudo_regno_live (regno);
}
/* Mark the register referenced by use or def REF as live. */ /* Mark the register referenced by use or def REF as live. */
static void static void
mark_ref_live (df_ref ref) mark_ref_live (df_ref ref)
...@@ -340,15 +355,7 @@ mark_ref_live (df_ref ref) ...@@ -340,15 +355,7 @@ mark_ref_live (df_ref ref)
reg = SUBREG_REG (reg); reg = SUBREG_REG (reg);
if (REGNO (reg) >= FIRST_PSEUDO_REGISTER) if (REGNO (reg) >= FIRST_PSEUDO_REGISTER)
{ mark_pseudo_reg_live (orig_reg, REGNO (reg));
if (df_read_modify_subreg_p (orig_reg))
{
mark_pseudo_regno_subword_live (REGNO (reg),
subreg_lowpart_p (orig_reg) ? 0 : 1);
}
else
mark_pseudo_regno_live (REGNO (reg));
}
else else
mark_hard_reg_live (reg); mark_hard_reg_live (reg);
} }
...@@ -445,6 +452,21 @@ mark_hard_reg_dead (rtx reg) ...@@ -445,6 +452,21 @@ mark_hard_reg_dead (rtx reg)
} }
} }
/* Mark a pseudo, or one of its subwords, as dead. REGNO is the pseudo's
register number; ORIG_REG is the access in the insn, which may be a
subreg. */
static void
mark_pseudo_reg_dead (rtx orig_reg, unsigned regno)
{
if (df_read_modify_subreg_p (orig_reg))
{
mark_pseudo_regno_subword_dead (regno,
subreg_lowpart_p (orig_reg) ? 0 : 1);
}
else
mark_pseudo_regno_dead (regno);
}
/* Mark the register referenced by definition DEF as dead, if the /* Mark the register referenced by definition DEF as dead, if the
definition is a total one. */ definition is a total one. */
static void static void
...@@ -466,26 +488,22 @@ mark_ref_dead (df_ref def) ...@@ -466,26 +488,22 @@ mark_ref_dead (df_ref def)
return; return;
if (REGNO (reg) >= FIRST_PSEUDO_REGISTER) if (REGNO (reg) >= FIRST_PSEUDO_REGISTER)
{ mark_pseudo_reg_dead (orig_reg, REGNO (reg));
if (df_read_modify_subreg_p (orig_reg))
{
mark_pseudo_regno_subword_dead (REGNO (reg),
subreg_lowpart_p (orig_reg) ? 0 : 1);
}
else
mark_pseudo_regno_dead (REGNO (reg));
}
else else
mark_hard_reg_dead (reg); mark_hard_reg_dead (reg);
} }
/* Make pseudo REG conflicting with pseudo DREG, if the 1st pseudo /* If REG is a pseudo or a subreg of it, and the class of its allocno
class is intersected with class CL. Advance the current program intersects CL, make a conflict with pseudo DREG. ORIG_DREG is the
point before making the conflict if ADVANCE_P. Return TRUE if we rtx actually accessed, it may be indentical to DREG or a subreg of it.
will need to advance the current program point. */ Advance the current program point before making the conflict if
ADVANCE_P. Return TRUE if we will need to advance the current
program point. */
static bool static bool
make_pseudo_conflict (rtx reg, enum reg_class cl, rtx dreg, bool advance_p) make_pseudo_conflict (rtx reg, enum reg_class cl, rtx dreg, rtx orig_dreg,
bool advance_p)
{ {
rtx orig_reg = reg;
ira_allocno_t a; ira_allocno_t a;
if (GET_CODE (reg) == SUBREG) if (GET_CODE (reg) == SUBREG)
...@@ -501,29 +519,31 @@ make_pseudo_conflict (rtx reg, enum reg_class cl, rtx dreg, bool advance_p) ...@@ -501,29 +519,31 @@ make_pseudo_conflict (rtx reg, enum reg_class cl, rtx dreg, bool advance_p)
if (advance_p) if (advance_p)
curr_point++; curr_point++;
mark_pseudo_regno_live (REGNO (reg)); mark_pseudo_reg_live (orig_reg, REGNO (reg));
mark_pseudo_regno_live (REGNO (dreg)); mark_pseudo_reg_live (orig_dreg, REGNO (dreg));
mark_pseudo_regno_dead (REGNO (reg)); mark_pseudo_reg_dead (orig_reg, REGNO (reg));
mark_pseudo_regno_dead (REGNO (dreg)); mark_pseudo_reg_dead (orig_dreg, REGNO (dreg));
return false; return false;
} }
/* Check and make if necessary conflicts for pseudo DREG of class /* Check and make if necessary conflicts for pseudo DREG of class
DEF_CL of the current insn with input operand USE of class USE_CL. DEF_CL of the current insn with input operand USE of class USE_CL.
Advance the current program point before making the conflict if ORIG_DREG is the rtx actually accessed, it may be indentical to
ADVANCE_P. Return TRUE if we will need to advance the current DREG or a subreg of it. Advance the current program point before
program point. */ making the conflict if ADVANCE_P. Return TRUE if we will need to
advance the current program point. */
static bool static bool
check_and_make_def_use_conflict (rtx dreg, enum reg_class def_cl, check_and_make_def_use_conflict (rtx dreg, rtx orig_dreg,
int use, enum reg_class use_cl, enum reg_class def_cl, int use,
bool advance_p) enum reg_class use_cl, bool advance_p)
{ {
if (! reg_classes_intersect_p (def_cl, use_cl)) if (! reg_classes_intersect_p (def_cl, use_cl))
return advance_p; return advance_p;
advance_p = make_pseudo_conflict (recog_data.operand[use], advance_p = make_pseudo_conflict (recog_data.operand[use],
use_cl, dreg, advance_p); use_cl, dreg, orig_dreg, advance_p);
/* Reload may end up swapping commutative operands, so you /* Reload may end up swapping commutative operands, so you
have to take both orderings into account. The have to take both orderings into account. The
constraints for the two operands can be completely constraints for the two operands can be completely
...@@ -534,12 +554,12 @@ check_and_make_def_use_conflict (rtx dreg, enum reg_class def_cl, ...@@ -534,12 +554,12 @@ check_and_make_def_use_conflict (rtx dreg, enum reg_class def_cl,
&& recog_data.constraints[use][0] == '%') && recog_data.constraints[use][0] == '%')
advance_p advance_p
= make_pseudo_conflict (recog_data.operand[use + 1], = make_pseudo_conflict (recog_data.operand[use + 1],
use_cl, dreg, advance_p); use_cl, dreg, orig_dreg, advance_p);
if (use >= 1 if (use >= 1
&& recog_data.constraints[use - 1][0] == '%') && recog_data.constraints[use - 1][0] == '%')
advance_p advance_p
= make_pseudo_conflict (recog_data.operand[use - 1], = make_pseudo_conflict (recog_data.operand[use - 1],
use_cl, dreg, advance_p); use_cl, dreg, orig_dreg, advance_p);
return advance_p; return advance_p;
} }
...@@ -554,6 +574,7 @@ check_and_make_def_conflict (int alt, int def, enum reg_class def_cl) ...@@ -554,6 +574,7 @@ check_and_make_def_conflict (int alt, int def, enum reg_class def_cl)
enum reg_class use_cl, acl; enum reg_class use_cl, acl;
bool advance_p; bool advance_p;
rtx dreg = recog_data.operand[def]; rtx dreg = recog_data.operand[def];
rtx orig_dreg = dreg;
if (def_cl == NO_REGS) if (def_cl == NO_REGS)
return; return;
...@@ -599,8 +620,8 @@ check_and_make_def_conflict (int alt, int def, enum reg_class def_cl) ...@@ -599,8 +620,8 @@ check_and_make_def_conflict (int alt, int def, enum reg_class def_cl)
if (alt1 < recog_data.n_alternatives) if (alt1 < recog_data.n_alternatives)
continue; continue;
advance_p = check_and_make_def_use_conflict (dreg, def_cl, use, advance_p = check_and_make_def_use_conflict (dreg, orig_dreg, def_cl,
use_cl, advance_p); use, use_cl, advance_p);
if ((use_match = recog_op_alt[use][alt].matches) >= 0) if ((use_match = recog_op_alt[use][alt].matches) >= 0)
{ {
...@@ -611,8 +632,8 @@ check_and_make_def_conflict (int alt, int def, enum reg_class def_cl) ...@@ -611,8 +632,8 @@ check_and_make_def_conflict (int alt, int def, enum reg_class def_cl)
use_cl = ALL_REGS; use_cl = ALL_REGS;
else else
use_cl = recog_op_alt[use_match][alt].cl; use_cl = recog_op_alt[use_match][alt].cl;
advance_p = check_and_make_def_use_conflict (dreg, def_cl, use, advance_p = check_and_make_def_use_conflict (dreg, orig_dreg, def_cl,
use_cl, advance_p); use, use_cl, advance_p);
} }
} }
} }
......
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