This is the mail archive of the 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 <> writes:

> This adds a memory clobber following a block containing variable arrays,
> to prevent the scheduler from moving references to such arrays below
> the stack pop.  (As suggested by Richard Henderson, thanks.)
> Bootstrapping on Darwin.

Some comments:

- This is presumably to fix a bug, but there's no testcase with the patch.

- 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.

- Shouldn't the clobber be attached to an insn rather than floating
  around loose?  For instance, the stack pop insn?  Otherwise it's
  possible that while the stores won't be moved below the stack pop,
  the stack pop might be moved above the stores, which will have
  pretty much the same effect.

For rs6000, we already have stack_tie_insn which is used for this
purpose, see rs6000_emit_stack_tie.

> 2002-08-08  Dale Johannesen  <>
>          * explow.c (emit_stack_restore): Emit a memory clobber
>          preceding the stack pop, to prevent the scheduler from
>          moving refs to variable arrays below this pop.
>          * reload1.c (reload): Preserve this clobber for sched2.
>          * doc/rtl.texi: Document clobber (mem:BLK (scratch)).

- Geoffrey Keating <> <>

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