This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: condition codes, haifa-sched and virtual-stack-vars
- From: Greg McGary <greg at mcgary dot org>
- To: law at redhat dot com
- Cc: Alexandre Oliva <aoliva at redhat dot com>, gcc at gcc dot gnu dot org
- Date: 30 Jan 2002 18:13:03 -0700
- Subject: Re: condition codes, haifa-sched and virtual-stack-vars
- References: <14553.1012438088@porcupine.cygnus.com>
law@redhat.com writes:
> > > if (REG_P (src)
> > > && REGNO (src) >= FIRST_PSEUDO_REGISTER
Oops. I meant FIRST_VIRTUAL_REGISTER here (it's the same constant though).
> > > && REGNO (src) <= LAST_VIRTUAL_REGISTER)
> >
> > I'd take the last condition out. Consider, for example, that you have
> > a very large stack frame, such that a pseudo ends up having to be
> > replaced with (plus (reg SP) (const_int VERY_LARGE_NUMBER))? Reload
> > may end up using a scratch register to construct this address, and it
> > will need an add to do that. Better be safe and consider any pseudo
> > reloading risky.
>
> I had pondered similar solutions, but rejected them as imparing
> optimization in too many ways. Some optimizers are more effective
> when moves are "simple".
I also wanted to keep them simple. I am choosing to live dangerously
and confine this hack to bare virtual regs only. The target is an
embedded processor without MMU whose entire stack buffers are nowhere
near the 64 Kbyte range of immediate offsets. Now that I think about
it, your idea about reworking conditional branches to keep the test
and branch together then splitting after reload feels like the cleaner
solution.
Greg