This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: inserting instructions into prologue/epilogue
- From: Ian Lance Taylor <ian at airs dot com>
- To: Gunther Nikl <gni at gecko dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: 03 Aug 2005 10:49:49 -0700
- Subject: Re: inserting instructions into prologue/epilogue
- References: <20050803144045.GA19698@lorien.int.gecko.de>
Gunther Nikl <gni@gecko.de> writes:
> 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.
As Nathan said, you can add a USE. Or in some cases the correct fix
is to define EPILOGUE_USES and/or EH_USES.
In some cases this error message can indicate a bug in the
prologue/epilogue code. For example, if you accidentally try to save
two different registers into the same stack slot, flow will cleverly
try to delete the first store, and then cleverly notice that it is
deleting a prologue insn. Similarly if you accidentally save a
register into a stack slot which is being used for a temporary
variable.
Ian