This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: inserting instructions into prologue/epilogue


Gunther Nikl <gni@gecko.de> writes:

>   Is EPILOGUE_USES only for the save and restore? I would have to add
>   some big chunk of code to it and that would propagate to several
>   places. It seems emitting a USE has lower impact.

EPILOGUE_USES doesn't emit code.  It simply takes a register and
returns whether the epilogue uses it, so that flow does not get
confused.

> > In some cases this error message can indicate a bug in the
> > prologue/epilogue code.
> 
>   Here is what I am trying to do: I have a rs6000 port using V.4 ABI.
>   The ABI has two fixed registers: r2 (_SDA2_BASE_) and r13 (_SDA_BASE_).
>   I suppose normally these are initialized in an assembly file. I want
>   the compiler emitting the appropriate load through a function attribute.
>   Since I change the register it has to be saved and restored as well.

Perhaps you should make sure that they are clear in
CALL_USED_REGISTERS, so that flow knows that they should not be
modified by the function, and that they are not modified by function
calls.  That is how you describe that the register value is live after
the function completes.

Although I guess that wouldn't work on a function by function basis,
so maybe EPILOGUE_USES would be an appropriate solution.
EPILOGUE_USES is another way to say that the value of the register is
live at the end of the function.

Ian


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