re PR target/64479 ([SH] wrong optimization delayed-branch)

gcc/
	PR target/64479
	* rtlanal.c (set_reg_p): Handle SEQUENCE constructs.

From-SVN: r219506
This commit is contained in:
Oleg Endo 2015-01-13 00:30:57 +00:00
parent ca46eab70b
commit d9a5f0cc4f
2 changed files with 17 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2015-01-13 Oleg Endo <olegendo@gcc.gnu.org>
PR target/64479
* rtlanal.c (set_reg_p): Handle SEQUENCE constructs.
2015-01-12 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.c (sh_atomic_assign_expand_fenv): New function.

View File

@ -1000,6 +1000,17 @@ reg_set_between_p (const_rtx reg, const rtx_insn *from_insn,
int
reg_set_p (const_rtx reg, const_rtx insn)
{
/* After delay slot handling, call and branch insns might be in a
sequence. Check all the elements there. */
if (INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE)
{
for (int i = 0; i < XVECLEN (PATTERN (insn), 0); ++i)
if (reg_set_p (reg, XVECEXP (PATTERN (insn), 0, i)))
return true;
return false;
}
/* We can be passed an insn or part of one. If we are passed an insn,
check if a side-effect of the insn clobbers REG. */
if (INSN_P (insn)
@ -1011,7 +1022,7 @@ reg_set_p (const_rtx reg, const_rtx insn)
GET_MODE (reg), REGNO (reg)))
|| MEM_P (reg)
|| find_reg_fusage (insn, CLOBBER, reg)))))
return 1;
return true;
return set_of (reg, insn) != NULL_RTX;
}