This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
new macro PRE_GCC3_DWARF_FRAME_REGISTERS
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc patches <gcc-patches at gcc dot gnu dot org>, David Edelsohn <dje at watson dot ibm dot com>
- Date: 06 Dec 2001 10:32:00 -0800
- Subject: new macro PRE_GCC3_DWARF_FRAME_REGISTERS
hullo.
as per our conversation, and the previous thread on DWARF_FRAME_REGS.
first, DWARF_FRAME_REGISTERS was undocumented. added docs.
second, added a new macro PRE_GCC3_DWARF_FRAME_REGISTERS for pre 3.0 EH
compatability.
the idea is to set PRE_GCC3_DWARF_FRAME_REGISTERS to the current value
of DWARF_FRAME_REGS in the ppc port, and add the altivec registers to
DWARF_FRAME_REGS. this way, EH still works with pre gcc3 compiled
glibc, *and* we new altivec code works.
*please correct me, i'm sure i'm muffing up the description above* :)
bootstrapped on x86.
ok?
--
Aldy Hernandez E-mail: aldyh@redhat.com
Professional Gypsy
Red Hat, Inc.
2001-12-05 Aldy Hernandez <aldyh@redhat.com>
Richard Henderson <rth@redhat.com>
* tm.texi (DWARF_FRAME_REGISTERS): Add documentation.
(PRE_GCC3_DWARF_FRAME_REGISTERS): Same.
* unwind-dw2.c (__frame_state_for): Change DWARF_FRAME_REGISTERS
to PRE_GCC3_DWARF_FRAME_REGISTERS.
(frame_state): Same.
(PRE_GCC3_DWARF_FRAME_REGISTERS): Define if not already defined.
Index: unwind-dw2.c
===================================================================
RCS file: /cvs/uberbaum/gcc/unwind-dw2.c,v
retrieving revision 1.12
diff -c -p -r1.12 unwind-dw2.c
*** unwind-dw2.c 2001/11/07 06:33:57 1.12
--- unwind-dw2.c 2001/12/06 18:18:33
***************
*** 42,47 ****
--- 42,52 ----
#define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
#endif
+ /* Dwarf frame registers used for pre gcc 3.0 compiled glibc. */
+ #ifndef PRE_GCC3_DWARF_FRAME_REGISTERS
+ #define PRE_GCC3_DWARF_FRAME_REGISTERS DWARF_FRAME_REGISTERS
+ #endif
+
/* This is the register and unwind state for a particular frame. */
struct _Unwind_Context
{
*************** typedef struct frame_state
*** 944,953 ****
void *eh_ptr;
long cfa_offset;
long args_size;
! long reg_or_offset[DWARF_FRAME_REGISTERS+1];
unsigned short cfa_reg;
unsigned short retaddr_column;
! char saved[DWARF_FRAME_REGISTERS+1];
} frame_state;
struct frame_state * __frame_state_for (void *, struct frame_state *);
--- 949,958 ----
void *eh_ptr;
long cfa_offset;
long args_size;
! long reg_or_offset[PRE_GCC3_DWARF_FRAME_REGISTERS+1];
unsigned short cfa_reg;
unsigned short retaddr_column;
! char saved[PRE_GCC3_DWARF_FRAME_REGISTERS+1];
} frame_state;
struct frame_state * __frame_state_for (void *, struct frame_state *);
*************** __frame_state_for (void *pc_target, stru
*** 974,980 ****
if (fs.cfa_how == CFA_EXP)
return 0;
! for (reg = 0; reg < DWARF_FRAME_REGISTERS + 1; reg++)
{
state_in->saved[reg] = fs.regs.reg[reg].how;
switch (state_in->saved[reg])
--- 979,985 ----
if (fs.cfa_how == CFA_EXP)
return 0;
! for (reg = 0; reg < PRE_GCC3_DWARF_FRAME_REGISTERS + 1; reg++)
{
state_in->saved[reg] = fs.regs.reg[reg].how;
switch (state_in->saved[reg])
Index: doc/tm.texi
===================================================================
RCS file: /cvs/uberbaum/gcc/doc/tm.texi,v
retrieving revision 1.71
diff -c -p -r1.71 tm.texi
*** tm.texi 2001/11/28 09:47:24 1.71
--- tm.texi 2001/12/06 18:18:35
*************** macros and should be used to refer to th
*** 3003,3008 ****
--- 3003,3035 ----
If the static chain is passed in a register, the two previous macros should
be defined instead.
+
+ @findex DWARF_FRAME_REGISTERS
+ @item DWARF_FRAME_REGISTERS
+ This macro specifies the maximum number of hard registers that can be
+ saved in a call frame. This is used to size data structures used in
+ DWARF2 exception handling.
+
+ If this macro is not defined, it defaults to
+ @code{FIRST_PSEUDO_REGISTER}.
+
+ @findex PRE_GCC3_DWARF_FRAME_REGISTERS
+ @item PRE_GCC3_DWARF_FRAME_REGISTERS
+
+ This macro is similar to @code{DWARF_FRAME_REGISTERS}, but is provided
+ for backward compatibility.
+
+ Prior to GCC 3.0, this macro was needed in order to establish a stable
+ exception handling ABI in the face of adding new hard registers for ISA
+ extensions. In GCC 3.0 and later, the EH ABI is insulated from changes
+ in the number of hard registers. Nevertheless, this macro can still be
+ used to reduce the runtime memory requirements of the exception handling
+ routines, which can be substantial if the ISA contains a lot of
+ registers that are not call-saved.
+
+ If this macro is not defined, it defaults to
+ @code{DWARF_FRAME_REGISTERS}.
+
@end table
@node Elimination