inserting instructions into prologue/epilogue
Gunther Nikl
gni@gecko.de
Wed Aug 3 14:40:00 GMT 2005
Hello!
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.
Then I used TARGET_ASM_FUNCTION_END_PROLOGUE to emit additional assembly
code. However this hook is _only_ called if prologue/epilogue instructions
are scheduled. Is that the expected behaviour? tm.texi doesn't mention this.
I tried to get rid of TARGET_ASM_FUNCTION_END_PROLOGUE by emitting the
loads as RTL, but then I also get flow.c aborts if prologue and epilogue
are scheduled. It works when not scheduling. This is the load code:
ref = gen_rtx_SYMBOL_REF (Pmode, "symbol");
emit_insn (gen_elf_high (reg, ref));
emit_insn (gen_elf_low (reg, reg, ref));
How do I prevent the aborts from flow? Any help appreciated.
Gunther Nikl
More information about the Gcc
mailing list