This is the mail archive of the 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

>    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.

We already do that though, see PR middle-end/20973.

> 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. 

Of course all of them (3) would need to be updated (like for the above PR).

>    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.

I'm not a specialist of DF so I don't know whether this is realistically 
doable, but the comment doesn't sound very encouraging:

      /* There is just too much going on in the register allocators to
	 keep things up to date.  At the end we have to rescan anyway
	 because things change when the reload_completed flag is set.  
	 So we just turn off scanning and we will rescan by hand.  

	 However, we needed to do the rescanning before this point to
	 get the new insns scanned inserted by local_alloc scanned for
	 global_conflicts.  */
      df_set_flags (DF_NO_INSN_RESCAN);

Comments on this comment?

Eric Botcazou

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