This is the mail archive of the gcc-patches@gcc.gnu.org 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]

Re: A little bit of additional flexibility in crtstuff.c


  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


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