This is the mail archive of the gcc@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: invalidate_mems_from_autoinc


Hello,

> > invalidate_mems_from_autoinc is used in this manner in mark_set_1 and
> > mark_used_regs:
> >
> > if (insn && GET_CODE (reg) == MEM)
> >   for_each_rtx (&PATTERN (insn), invalidate_mems_from_autoinc, pbi);
> >
> > Is there some reason for passing through the whole insn for every MEM I
> > encounter? Would not either one call at top level, or (a bit better for
> > my purposes)
> >
> > if (GET_CODE (reg) == MEM)
> >   for_each_rtx (&reg, invalidate_mems_from_autoinc, pbi);
> >
> > suffice?
> 
> Look at what invalidate_mems_from_autoinc() does.  It needs to scan
> the whole pattern of the insn to search for auto-modifying RTL expressions
> (those with rtx class 'a').  If it only would scan REG (as you proposed)
> it would find auto-modifying _uses_ of mems (whose entries in the list
> needs to be deleted then).

It is called from mark_used_regs and from mark_set_1; so it would be
called for all MEMs (and rtx's with class 'a' should not occur anywhere
else, right?)

Anyway, calling it again and again for each MEM in the insn still makes
no sense to me.

Zdenek


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