This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Share clobbers of hard registers...
> > > > Hmm, what it makes difference on whether it is REG/v or REG?
> > >
> > > Clobber is shared thus it is different to REG_UNUSED note,
> > > thus find_reg_note on reg-stack.c:1413 and 1428 does not find a note.
> >
> > Maybe better fix would be write something like find_reg_notes but more
> > intelligent...
>
> This is interesting too, I wonder how the REG_UNUSED note can happen to
> use different pseudo. I am trying to look into it now.
Hi,
it looks like reg-stack is only place that is missdesigned enough to
modify internals of clobbers of hard registers. This patch seems to fix
it, I am running full testing now.
2004-02-05 Jan Hubicka <jh@suse.cz>
* reg-stack.c (subst_stack_regs): Unshare clobbers before substitution.
Index: reg-stack.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reg-stack.c,v
retrieving revision 1.142
diff -c -3 -p -r1.142 reg-stack.c
*** reg-stack.c 2 Feb 2004 00:17:17 -0000 1.142
--- reg-stack.c 5 Feb 2004 11:24:56 -0000
*************** subst_stack_regs (rtx insn, stack regsta
*** 2236,2244 ****
for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++)
{
if (stack_regs_mentioned_p (XVECEXP (PATTERN (insn), 0, i)))
! control_flow_insn_deleted
! |= subst_stack_regs_pat (insn, regstack,
! XVECEXP (PATTERN (insn), 0, i));
}
else
control_flow_insn_deleted
--- 2236,2249 ----
for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++)
{
if (stack_regs_mentioned_p (XVECEXP (PATTERN (insn), 0, i)))
! {
! if (GET_CODE (XVECEXP (PATTERN (insn), 0, i)) == CLOBBER)
! XVECEXP (PATTERN (insn), 0, i)
! = shallow_copy_rtx (XVECEXP (PATTERN (insn), 0, i));
! control_flow_insn_deleted
! |= subst_stack_regs_pat (insn, regstack,
! XVECEXP (PATTERN (insn), 0, i));
! }
}
else
control_flow_insn_deleted