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


Hi,

On Tue, 3 Dec 2002, Zdenek Dvorak wrote:

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


Ciao,
Michael.


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