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: [RFC] Fix PR rtl-optimization/33732


On Mon, Nov 05, 2007 at 11:15:44AM +0100, Eric Botcazou wrote:
> This stems from the REG_DEAD note on insn 70.  Right after global alloc:
> 
> (insn 70 73 71 4 longlong.c:19 (set (reg:SI 88 SAR [140])
>         (minus:SI (const_int 31 [0x1f])
>             (subreg:SI (reg:DI 21 %r21 [137]) 4))) 119 {*pa.md:5698} 
> (expr_list:REG_DEAD (reg:DI 21 %r21 [137])
>         (nil)))
> 
> is not correct anymore because only (subreg:SI (reg:DI 21 %r21 [137]) 4) is
> dead, not (reg:SI 21 %r21), which fools the optimization in combine_reloads
[snip]
> I'm not sure what the best approach to fixing this is.  Should we disregard
> notes referencing former pseudo-registers that have been assigned more than
> one hard register, between global alloc and reload?

   Can't df be used to update the REG_DEAD notes right after renumbering
pseudos into hard regs? IMHO that'd be better than making a part of reload
handle REG_DEAD notes specially. It's difficult enough as it is to predict
what reload will do for a given input. Also, there may well be other places
in reload which are fooled by incorrect REG_DEAD notes.

   Currently, we stop df from keeping its data up-to-date shortly before
calling reload() (in two places in global.c). Suppose we move that into
reload1.c/reload() itself after this bit:

  /* Alter each pseudo-reg rtx to contain its hard reg number.
     Assign stack slots to the pseudos that lack hard regs or equivalents.
     Do not touch virtual registers.  */

  for (i = LAST_VIRTUAL_REGISTER + 1; i < max_regno; i++)
    alter_reg (i, -1);

   At this point, df should be able to update the REG_DEAD notes. Then we
can turn off df rescanning for the rest of reload.

-- 
Rask Ingemann Lambertsen
Danish law requires addresses in e-mail to be logged and stored for a year


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