This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ping Zdenek's patch for 17428
Hello,
> On Sun, 13 Feb 2005, Zdenek Dvorak wrote:
> > I believe that most of the time no hard register at all should be live
> > at the point where the insertion happens. This is the reason why I did
> > not want to make things more complicated than necessary. Simply
> > disabling the optimization in case any hard reg is live at the point
> > would IMHO work as well.
>
> That certainly simplifies things. Could you collect some statistics
> on what fraction of the calls to safe_insert_insn_on_edge have a live
> non-fixed hard regsiter, and if so how many? If, as you suggest, the
> majority of the time there are no live registers, and when there are
> we only spill one or two, then the patch may be fine as it is.
with the following minor modification of the patch (the
!REGNO_PTR_FRAME_P condition to avoid saving ebp) we get the following
numbers of extra registers saved (on athlon and partial boostrap of
gcc):
32958 times 0
26 times 1
21 times 2
24 times 3
Zdenek
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
retrieving revision 1.157
diff -c -3 -p -r1.157 cfgrtl.c
*** cfgrtl.c 6 Jan 2005 18:05:27 -0000 1.157
--- cfgrtl.c 13 Feb 2005 22:23:41 -0000
*************** safe_insert_insn_on_edge (rtx insn, edge
*** 1470,1475 ****
--- 1470,1485 ----
for (x = insn; x; x = NEXT_INSN (x))
if (INSN_P (x))
note_stores (PATTERN (x), mark_killed_regs, killed);
+
+ /* Mark all hard registers as killed. Register allocator/reload cannot
+ cope with the situation when life range of hard register spans operation
+ for that the appropriate register is needed, i.e. it would be unsafe to
+ extend the life ranges of hard registers. */
+ for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
+ if (!fixed_regs[regno]
+ && !REGNO_PTR_FRAME_P (regno))
+ SET_REGNO_REG_SET (killed, regno);
+
bitmap_and_into (killed, e->dest->global_live_at_start);
EXECUTE_IF_SET_IN_REG_SET (killed, 0, regno, rsi)
Index: value-prof.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/value-prof.c,v
retrieving revision 1.16
diff -c -3 -p -r1.16 value-prof.c
*** value-prof.c 14 Nov 2004 23:35:03 -0000 1.16
--- value-prof.c 13 Feb 2005 22:23:41 -0000
*************** insn_prefetch_values_to_profile (rtx ins
*** 245,251 ****
int write;
histogram_value hist;
! if (!INSN_P (insn))
return false;
if (!find_mem_reference (insn, &mem, &write))
--- 245,252 ----
int write;
histogram_value hist;
! /* It only makes sense to look for memory references in ordinary insns. */
! if (GET_CODE (insn) != INSN)
return false;
if (!find_mem_reference (insn, &mem, &write))