This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [new-ra] DF_REF_REG_CLOBBER related bugfix
- From: Denis Chertykov <denisc at overta dot ru>
- To: Michael Matz <matz at suse dot de>
- Cc: Denis Chertykov <denisc at overta dot ru>, gcc-patches at gcc dot gnu dot org
- Date: 24 Oct 2003 21:10:17 +0400
- Subject: Re: [new-ra] DF_REF_REG_CLOBBER related bugfix
- References: <Pine.LNX.4.44.0310241416440.16615-100000@wotan.suse.de>
Michael Matz <matz@suse.de> writes:
> Hi Denis,
>
> On Fri, 24 Oct 2003, Denis Chertykov wrote:
>
> > Current `insert_stores' handle (clobber REG) as def. It's wrong.
> > The slot for REG must be deleted from `slots' hash list.
>
> Indeed. Please commit.
>
> > (coalesce_spill_slot): Handle webs without conflicts.
> >
> > --- 2345,2355 ----
> > }
> > else
> > return 0;
> > !
> > ! /* Webs without conflicts must be rejected. */
> > ! if (!s->conflict_list || !t->conflict_list)
> > ! return 0;
> > !
>
> For what is this needed? Could you extend the comment?
After you have added a support of webs with "xcall" attribute you have
enabled webs without usable_regs and without conflict_list.
This is a spill-webs which will be definitely in stack memory.
coalesce_spill_slot can't handle such webs because they havn't
conflicts with 'corresponding webs'.
IE:
w1 - web without conflict_list (now w1 got stack slot)
w2 - 'corresponding web' (web which connected to w1 by move) and
havn't a conflict with w1 because of w1->usable_regs is empty
i1 def w1
....
i2 move w2 <= w1
i3 def w2, use w2
i4 use w2
i5 use w1
coalesce_spill_slot will try to coalesce w1 with w2.
The following condition isn't work
(it's condition from `non_conflicting_for_combine' and similar
condition exists in coalesce_spill_slot):
if (!TEST_BIT (sup_igraph, w1->id * num_webs + w2->id)
&& !TEST_BIT (sup_igraph, w2->id * num_webs + w1->id))
return 1;
So, the result:
i1 def w1-slot
....
INSN_DELETED i2 move w2 <= w1
i3 def w1-slot, use w1-slot
i4 use w1-slot
i5 use w1-slot
It's a buggy result because w2 has a def in i3.
May be non_conflicting_for_combine will have a similar problem ?
Also, Right now I have understood the following thing:
By my idea coalesce_spill_slot must remove all unnecessary moves
generated by rewrite_program2 if the web will be in stack but in
described example coalesce_spill_slot tries to delete move which
wasn't generated by rewrite_program2. It's not a bug. It's a bit
wrong realization ;(
Denis.