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: [patch] Store motion rewrite


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


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