This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: scheduling vs variable arrays
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Dale Johannesen <dalej at apple dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 08 Aug 2002 18:12:35 -0700
- Subject: Re: Patch: scheduling vs variable arrays
- References: <746E538D-AB2E-11D6-846A-003065C86F94@apple.com>
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>