This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ping Zdenek's patch for 17428



On Sun, 13 Feb 2005, Nathanael Nerode wrote:
> Zdenek has a patch:
> http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02116.html
>
> which fixes 17428 and 17491.  It looks very safe, but has apparently
> not been reviewed.

The change to value-prof.c is obviously acceptable, but my feeling
is that the change to safe_insert_insn_on_edge is probably far to
big a hammer.  To work around the reload failure of a prefetch insn,
do we really need to spill and restore every hard register that's
live over that edge.  On PowerPC, this spills any altivec registers
in use, on x86, this spills any x87, MMX and SSE registers, etc...

Isn't there a better way?


A lot less intrusive solution might be to require speculative prefetch
instructions to include a clobber for the one or two hard registers
that may be needed during reload.  safe_insert_insn_edge already
saves an restores any live registers that are visibly modified by the
instruction, so adding a clobber of %eax would be far less disruptive
than saving and restoring every non-fixed hard register.

Or if that's too ugly, perhaps a target hook for prefetch_clobbers?
It might even be possible to just kill the first register (or N first
registers) (in register allocation order) that are in GENERAL_REGS?
I'm completely guessing.

Fortunately, safe_insert_insn_on_edge is currently only called from
rtl-profile.c.


RTH is more of an expert that I, but I just thought I'd point out
that perhaps its this overkill thats the reason this solution hasn't
previously been approved/commented on.

Roger
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]