This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Store motion rewrite
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: "Sanjiv Kumar Gupta, Noida" <sanjivg at noida dot hcltech dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 4 Apr 2003 09:53:12 +0200
- Subject: Re: [patch] Store motion rewrite
- References: <E04CF3F88ACBD5119EFE00508BBB212108742C62@exch-01.noida.hcltech.com>
Hello,
> > > ! /* But even a const call reads its parameters. Check whether
> the
> > > ! base of some of registers used in mem is stack pointer. */
> > > ! for (reg = x_regs; reg; reg = XEXP (reg, 1))
> > > ! {
> > > ! base = find_base_term (reg);
> > > ! if (!base
> > > ! || (GET_CODE (base) == ADDRESS
> > > ! && GET_MODE (base) == Pmode
> > > ! && XEXP (base, 0) == stack_pointer_rtx))
> > > ! return true;
>
> Following piece of code returns true if base of reg
> is a stack reference.
>
> base = find_base_term (reg);
> if (base
> && (GET_CODE (x_base) == ADDRESS
> && GET_MODE (x_base) == Pmode)
> && XEXP (base, 0) == stack_pointer_rtx))
> return true;
but I am not 100% sure that registers that are newly created do not have
something in common with stack (well, probably they do not, as they are
only created to store values of mems, so this would be safe too; but
anyway it makes almost no difference)
Zdenek