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
Denis Chertykov <denisc@overta.ru> writes:
> > Yes, and that would then prevent the coalescing. You want to use the
> > emptyness of conflict_list, I want to use the fact that the usable_regs
> > don't overlap at all to prevent this. At least, that's how I understood
> > you: you have to prevent coalescing of spill slots for webs where one has
> > no usable_regs, because the conflict information isn't filled out
> > otherwise. But it's not just not filled out when usable_regs is empty,
> > but also if both usable_regs don't intersect, so that's what should be
> > tested.
>
> Yes. You right. I think about this while write example with w1 and w2.
>
> I will rewrite the part of patch before committing.
New patch.
2003-10-25 Denis Chertykov <denisc@overta.ru>
* ra-rewrite.c (insert_stores): Skip clobbered REGs.
Remove slot for REG from slots hash list.
(coalesce_spill_slot): Coalesce webs only with combinable
usable_regs.
Index: ra-rewrite.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ra-rewrite.c,v
retrieving revision 1.1.2.22
diff -c -3 -p -r1.1.2.22 ra-rewrite.c
*** ra-rewrite.c 13 Oct 2003 13:02:27 -0000 1.1.2.22
--- ra-rewrite.c 25 Oct 2003 06:54:08 -0000
*************** delete_overlapping_uses (rtx *px, void *
*** 685,691 ****
}
}
! /* Returns nonzero, of X is member of LIST. */
static int
slot_member_p (struct rtx_list *list, rtx x)
--- 685,691 ----
}
}
! /* Returns nonzero, if X is member of LIST. */
static int
slot_member_p (struct rtx_list *list, rtx x)
*************** insert_stores (bitmap new_deaths)
*** 744,750 ****
rtx slot, source;
struct web *web = def2web[DF_REF_ID (info.defs[n])];
struct web *aweb = alias (find_web_for_subweb (web));
!
if (aweb->type != SPILLED || !aweb->stack_slot)
continue;
if (web->pattern || aweb->pattern)
--- 744,756 ----
rtx slot, source;
struct web *web = def2web[DF_REF_ID (info.defs[n])];
struct web *aweb = alias (find_web_for_subweb (web));
!
! /* Clobber is not a def. */
! if (DF_REF_TYPE (info.defs[n]) == DF_REF_REG_CLOBBER)
! {
! delete_overlapping_slots (&slots, DF_REF_REG (info.defs[n]));
! continue;
! }
if (aweb->type != SPILLED || !aweb->stack_slot)
continue;
if (web->pattern || aweb->pattern)
*************** coalesce_spill_slot (web, ref, place)
*** 2339,2345 ****
}
else
return 0;
!
if (s == web)
dweb = t;
else if (t == web)
--- 2345,2351 ----
}
else
return 0;
!
if (s == web)
dweb = t;
else if (t == web)
*************** coalesce_spill_slot (web, ref, place)
*** 2352,2358 ****
return 0;
if (TEST_BIT (sup_igraph, s->id * num_webs + t->id)
! || TEST_BIT (sup_igraph, t->id * num_webs + s->id))
return 0;
move_insn = insn;
--- 2358,2365 ----
return 0;
if (TEST_BIT (sup_igraph, s->id * num_webs + t->id)
! || TEST_BIT (sup_igraph, t->id * num_webs + s->id)
! || ! hard_regs_combinable_p (s, t))
return 0;
move_insn = insn;