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: [dataflow RFA] Remove DF_SUBREGS scanning flag


Hello,

> loop-iv.c dealt with subregs like this:
> 
>  rtx reg = DF_REF_REG (def);
>  ...
>  set = single_set (insn);
>  if (!set || SET_DEST (set) != reg)
>    return false;
> 
> This shows why the old behavior without DF_SUBREGS is pretty much 
> broken.  We get the DEF (which is not artificial, it is taken from an 
> insn), and it may not be the SET_DEST of the insn!  From my analysis, 
> this actually happened when the SET_DEST was a subreg, but I'm CCing 
> Zdenek in case this rings a bell.  After this patch, we have this code 
> which is more clear:
> 
>  rtx reg = DF_REF_REG (def);
>  ...
>  if (!REG_P (reg))
>    return false;
> 
>  set = single_set (insn);
>  if (!set)
>     return false;
> 
>  gcc_assert (SET_DEST (set) == reg);
> 
> This simply rejects all subregs, and is able to perform a consistency 
> check on the dataflow info.

yes, this looks ok to me.

Zdenek


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