This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: A little bit of additional flexibility in crtstuff.c
- To: Jason Merrill <jason at redhat dot com>
- Subject: Re: A little bit of additional flexibility in crtstuff.c
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Fri, 25 Aug 2000 13:01:35 -0600
- cc: Alexandre Oliva <aoliva at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <u9lmxlgs3q.fsf@yorick.soma.redhat.com>you write:
> > There may be several reasons. One example is register allocation:
> > since only the naked call is placed in the init/fini functions, it
> > might be that the generated code assumed some particular register
> > state that the naked code in init/fini doesn't satisfy. Another
> > situation in which assembly code may be needed is when large constants
> > can't be loaded directly into registers, and GCC ends up emitting them
> > as separate constants. In this case, GCC may emit the constant in a
> > different section than the actual code, and the reference to the
> > constant location may turn out to be invalid for its being too far
> > away.
>
> Why aren't these situations dealt with by only putting calls with no args
> in init/fini?
Consider the case where the ISA only supports indirect calls and the target
can not easily load the address of the function into a register, but instead
sucks it out of a constant pool in memory via pc-relative loads.
jeff