RFA: patch to solve PR41241

Jeff Law law@redhat.com
Thu Sep 3 18:33:00 GMT 2009


On 09/03/09 12:18, Vladimir Makarov wrote:
>
>
>  The following patch fixes PR41241
> (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41241).  The problem was
> triggered by the new patches.  Update_equiv_reg imported from the old
> RA used initialized preferred reg class of pseudo in the following
> fragment.
>
>  /* ??? The mn10200 port breaks if we add equivalences for
>     values that need an ADDRESS_REGS register and set them equivalent
>     to a MEM of a pseudo.  The actual problem is in the over-conservative
>     handling of INPADDR_ADDRESS / INPUT_ADDRESS / INPUT triples in
>     calculate_needs, but we traditionally work around this problem
>     here by rejecting equivalences when the destination is in a register
>     that's likely spilled.  This is fragile, of course, since the
>     preferred class of a pseudo depends on all instructions that set
>     or use it.  */
>
>  if (!REG_P (dest)
>      || (regno = REGNO (dest)) < FIRST_PSEUDO_REGISTER
>      || reg_equiv[regno].init_insns == const0_rtx
>      || (CLASS_LIKELY_SPILLED_P (reg_preferred_class (regno))
> && MEM_P (src) && ! reg_equiv[regno].is_arg_equivalence))
>
> At this stage of IRA the preferred and alternative register classes is
> not defined yet.  So I've just removed the code containing
> reg_preferred_class.  This code is predated by 1999.  It was very
> fragile fix for mn10200.  The right solution would be fixing it in
> reload and hope it was fixed because the fix here was very very
> fragile.  I think it was just work around, not a real solution of the
> problem.  Also this target (mn10200) is not supported anymore.  I do
> not exclude that some weird target might be broken.  But I think the
> probability of this is very low.  And if it happens, the problem
> should be fixed in reload.
>
> The patch removes the valgrind errors and was successfully
> bootstrapped on 2 machines x86 and x86_64.
>
> Ok to commit it into the trunk?
>
> 2009-09-03  Vladimir Makarov <vmakarov@redhat.com>
>
>    PR bootstrap/41241
>    * ira.c (update_equiv_reg): Remove check on class likely spill.
I'm not sure this is safe -- the mn102 change was merely generalizing 
some existing code.  Prior to the mn102 change we rejected rejected 
pseudos which preferred a register class with a single register.    The 
mn102 change merely extended that to rejecting pseudos which preferred a 
class that was likely spilled.

Jeff



More information about the Gcc-patches mailing list