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: scheduling vs variable arrays


Dale Johannesen <dalej@apple.com> writes:

> On Thursday, August 8, 2002, at 04:56 PM, Geoff Keating wrote:
> >
> > - I think it would be better to use (clobber (mem:BLK (reg:P sp)))
> >   because that makes it clear that only stack memory is involved.
> 
> On second thought Richard Henderson's comment below suggests this won't
> work:
> 
> >  Ideally we'd just clobber all stack memory, but
> > we need this special form in order to match bits marked
> > with RTX_UNCHANGING_P.  Which IMO is sort of a historical
> > mistake for any stack variable.

That's a different bug.  You can't mark stack memory that's popped
with RTX_UNCHANGING_P, because you could get a sequence like (suppose
that the frame pointer starts off equal to sp):

// push 16 bytes
(set (mem/u (plus (reg:P fp) (const_int -8)) thing_1)
// pop 16 bytes
// push 32 bytes
(set (mem/u (plus (reg:P fp) (const_int -8)) thing_2)

where thing_1 != thing_2.  This is a violation of the RTX_UNCHANGING_P
rules, so you just can't have that memory marked with
RTX_UNCHANGING_P.

It's OK to use RTX_UNCHANGING_P with stack variables that aren't
popped, because those really won't change.  Well, sort of.

-- 
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>


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