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]
Other format: [Raw text]

[PATCH, nios2] Fix frame pointer calculation


The current Nios II prologue/epilogue code has a bug where the frame
pointer points to the start of the register save area, rather than the
frame slot where FP is saved (as specified the Nios II ABI).

This was only discovered relatively recently, as dwarf-based unwinding
is used most of the time, plus nios2 GDB's prologue analyzer is capable
of determining where FP is stored. Still this needs to fixed to be
conformant to the ABI.

Tested (both the compiler and gdb) and applied to trunk.

Chung-Lin

2014-03-11  Chung-Lin Tang  <cltang@codesourcery.com>

	* config/nios2/nios2.c (machine_function): Add fp_save_offset
	field.
	(nios2_compute_frame_layout):
	Add calculation of cfun->machine->fp_save_offset.
	(nios2_expand_prologue): Correct setting of frame pointer
	register in prologue.
	(nios2_expand_epilogue): Update recovery of stack pointer from
	frame pointer accordingly.
	(nios2_initial_elimination_offset): Update calculation of offset
	for eliminating to HARD_FRAME_POINTER_REGNUM.

Attachment: nios2-fp.patch
Description: Text document


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