This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Don't lose asm sets of frame pointer
On Mon, Nov 24, 2003 at 05:19:45PM -0800, Richard Henderson wrote:
> On Tue, Nov 25, 2003 at 09:54:58AM +1030, Alan Modra wrote:
> > On Mon, Nov 24, 2003 at 04:33:33PM +0100, Falk Hueffner wrote:
> > > does gcc now error out if
> > > you try to clobber the FP in an asm, but gcc needs it?
> >
> > No. The patch doesn't do anything about detecting use of FP in asms
> > when gcc needs it as a frame pointer.
>
> Then what does it do?
It stops gcc global_alloc allocating FP or other eliminable regs when
a) they're available for use as general regs
b) except that an asm wants to use them.
> Certainly it seems like you have most of
> the information that you need to do so. Continuing to silently
> accept (or ICE on) code that will not function is wrong.
Agreed. One step at a time! What you're asking here is to error out
on "silly" asms that make improper use of regs. What I'm providing is a
way for not-so-silly asms to work in the face of global_alloc's register
allocation.
> > Incidentally, the testcase originally came from Oracle, who apparently
> > hit the r30 problem in real code.
>
> Care to share that test case? We'll need several of these added
> to the testsuite if you expect this to not break in the future.
The test case in the PR 13169 looks quite similar to the one I got from
Oracle. ie. They had already reduced the code for me. I imagine the
real code had a function with a lot of register pressure and an asm
making use of r30. Which is what the testcase does all in one asm.
--
Alan Modra
IBM OzLabs - Linux Technology Centre