This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: inserting instructions into prologue/epilogue
On Wed, Aug 03, 2005 at 03:50:09PM +0100, Nathan Sidwell wrote:
> Gunther Nikl wrote:
> >I am trying to add instructions into function prologue/epilogue. These
> >instructions shall save and load "fixed" registers to avoid assembly.
> >
> >Register saving in the prologue appears to work. The restore code in the
> >epilogue aborts in flow.c/propagate_one_insn with
> >
> > "Attempt to delete prologue/epilogue insn"
> >
> >unless the stackslot was marked with MEM_VOLATILE_P. I don't think thats
> >the proper fix.
>
> you can add a (USE reg) after the restore in the prologue. Then flow
> considers the register, and the preceding load, to be live at that point.
Thank you. With "emit_insn (gen_rtx_USE (VOIDmode, reg))" the abort
disappears. The same approach seems to fix the loads in the prologue.
I hope that this is the correct solution.
On Wed, Aug 03, 2005 at 03:53:21PM +0100, Nathan Sidwell wrote:
> Nathan Sidwell wrote:
>
> >you can add a (USE reg) after the restore in the prologue. Then flow
> in the EPILOGUE, of course
I wouldn't have notice this mistake without your mail.
Thank you for the help.
Gunther
> >considers the register, and the preceding load, to be live at that point.