This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: invalidate_mems_from_autoinc
- From: Michael Matz <matz at suse dot de>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Tue, 3 Dec 2002 12:23:08 +0100 (CET)
- Subject: 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 (®, 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.