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: Dale Johannesen <dalej at apple dot com>
- To: Geoff Keating <geoffk at geoffk dot org>
- Cc: Dale Johannesen <dalej at apple dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 8 Aug 2002 17:22:19 -0700
- Subject: Re: Patch: scheduling vs variable arrays
On Thursday, August 8, 2002, at 04:56 PM, Geoff Keating wrote:
Dale Johannesen <dalej@apple.com> 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 haven't been able to construct one that fails repeatably. The bug is
a possible clobber during context switches/interrupts as discussed in
the thread yesterday. Hmm, maybe on a stack-parameter machine I can
persuade it to clobber something with a parameter store...
- 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.
Thanks, I agree; didn't realize this would work. This is portable to all
targets, right?
- 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.
I don't think this is a problem, judging from the dependencies I'm
seeing in the scheduler dumps. Could be wrong. You mean stick them
together inside a parallel() ? Wouldn't that require writing matching
patterns for each target?
For rs6000, we already have stack_tie_insn which is used for this
purpose, see rs6000_emit_stack_tie.
It isn't used in this case, but thanks, I'll look.