This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC Patch: Fix bad eh_frame data for MIPS.
- From: David Daney <ddaney at avtrex dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 17 Sep 2003 17:43:20 -0700
- Subject: Re: RFC Patch: Fix bad eh_frame data for MIPS.
- References: <3F68D2B2.3060401@avtrex.com> <20030917224718.GB23340@redhat.com>
Richard Henderson wrote:
On Wed, Sep 17, 2003 at 02:31:30PM -0700, David Daney wrote:
* gcc/config/mips/linux.h (MD_FALLBACK_FRAME_STATE_FOR): New,
needed for mips/libgcj signal handling.
* gcc/config/mips/mips.h (DWARF_FRAME_REGNUM_FOR_INITIAL_RETURN_SAVE): New.
* gcc/dwarf2out.c (DWARF_FRAME_REGNUM_FOR_INITIAL_RETURN_SAVE): New.
* gcc/dwarf2out.c (initial_return_save): Use
DWARF_FRAME_REGNUM_FOR_INITIAL_RETURN_SAVE instead of DWARF_FRAME_REGNUM
This is wrong.
The existing DWARF_FRAME_REGNUM is completely wrong for mips.
After deleting that, you have a choice of:
(1) Leaving DWARF_FRAME_RETURN_COLUMN alone, and adding a
REG_FRAME_RELATED_EXPR to the insn that saves r31 on the stack.
The expression would mention (reg DWARF_FRAME_RETURN_COLUMN).
I don't quite understand. The main problem is when r31 is not being
saved on the stack. The return address is in r31 and not saved anywhere
else. That has to be communicated to eh_frame
(2) Set
#define DWARF_FRAME_RETURN_COLUMN GP_REG_FIRST+31
This will produce smaller CFI output. I don't know if SGI's
debugger can handle overlapping r31 with the return address.
Gcc and gdb can.
Would this change cause binary compatibility problems with existing
versions of libgcc_s.so.1 and libstdc++.so ?
In short, my patch although "wrong" seems to work.
If I do #2 and it works for me (unknown at this point), is it an
acceptable solution and would it be applied to the gcc mainline?
David Daney.