aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/alpha/alpha.h1
-rw-r--r--gcc/config/rs6000/rs6000.h1
-rw-r--r--gcc/config/sparc/sparc.h1
-rw-r--r--gcc/frame.c24
-rw-r--r--gcc/frame.h3
-rw-r--r--gcc/libgcc2.c16
7 files changed, 30 insertions, 26 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ec5fd06..7b35f67 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2000-03-22 Jason Merrill <jason@casey.cygnus.com>
+
+ * config/rs6000/rs6000.h (DWARF_FRAME_RETURN_COLUMN): Define.
+ * config/alpha/alpha.h (DWARF_FRAME_RETURN_COLUMN): Define.
+ * config/sparc/sparc.h (DWARF_FRAME_RETURN_COLUMN): Define.
+
+ * frame.h (frame_state): Revert last change.
+ * frame.c (execute_cfa_insn): Just don't record the save of a CFA reg.
+ * libgcc2.c (throw_helper): Revert last change.
+
2000-03-22 Richard Henderson <rth@cygnus.com>
* stmt.c (expand_asm_operands): Don't promote the temporary.
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index 15a4b31..4fadf8e 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -1328,6 +1328,7 @@ do { \
/* Before the prologue, RA lives in $26. */
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, 26)
+#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (26)
/* Addressing modes, and classification of registers for them. */
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index e55ae93..9d3babd 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -2670,6 +2670,7 @@ do { \
mechanism. */
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM)
+#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (LINK_REGISTER_REGNUM)
/* Define results of standard character escape sequences. */
#define TARGET_BELL 007
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 0da6cd6..b42f508 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -2184,6 +2184,7 @@ LFLGRET"ID":\n\
is something you can return to. */
#define INCOMING_RETURN_ADDR_RTX \
plus_constant (gen_rtx_REG (word_mode, 15), 8)
+#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (15)
/* The offset from the incoming value of %sp to the top of the stack frame
for the current function. On sparc64, we have to account for the stack
diff --git a/gcc/frame.c b/gcc/frame.c
index 688355a..cfd979b 100644
--- a/gcc/frame.c
+++ b/gcc/frame.c
@@ -694,11 +694,16 @@ execute_cfa_insn (void *p, struct frame_state_internal *state,
{
reg = (insn & 0x3f);
p = decode_uleb128 (p, &offset);
- offset *= info->data_align;
- state->s.saved[reg] = REG_SAVED_OFFSET;
- state->s.reg_or_offset[reg] = offset;
if (reg == state->s.cfa_reg)
- state->s.cfa_saved = 1;
+ /* Don't record anything about this register; it's only used to
+ reload SP in the epilogue. We don't want to copy in SP
+ values for outer frames; we handle restoring SP specially. */;
+ else
+ {
+ offset *= info->data_align;
+ state->s.saved[reg] = REG_SAVED_OFFSET;
+ state->s.reg_or_offset[reg] = offset;
+ }
}
else if (insn & DW_CFA_restore)
{
@@ -727,11 +732,14 @@ execute_cfa_insn (void *p, struct frame_state_internal *state,
case DW_CFA_offset_extended:
p = decode_uleb128 (p, &reg);
p = decode_uleb128 (p, &offset);
- offset *= info->data_align;
- state->s.saved[reg] = REG_SAVED_OFFSET;
- state->s.reg_or_offset[reg] = offset;
if (reg == state->s.cfa_reg)
- state->s.cfa_saved = 1;
+ /* Don't record anything; see above. */;
+ else
+ {
+ offset *= info->data_align;
+ state->s.saved[reg] = REG_SAVED_OFFSET;
+ state->s.reg_or_offset[reg] = offset;
+ }
break;
case DW_CFA_restore_extended:
p = decode_uleb128 (p, &reg);
diff --git a/gcc/frame.h b/gcc/frame.h
index ecaf6b0..330277c 100644
--- a/gcc/frame.h
+++ b/gcc/frame.h
@@ -1,6 +1,6 @@
/* Header file for unwinding stack frames for exception handling. */
/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
Contributed by Jason Merrill <jason@cygnus.com>.
This file is part of GNU CC.
@@ -34,7 +34,6 @@ typedef struct frame_state
long reg_or_offset[DWARF_FRAME_REGISTERS+1];
unsigned short cfa_reg;
unsigned short retaddr_column;
- char cfa_saved;
char saved[DWARF_FRAME_REGISTERS+1];
} frame_state;
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index aafbe75..e2a852c 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -3679,7 +3679,6 @@ throw_helper (struct eh_context *eh, void *pc, frame_state *my_udata,
void *handler;
void *handler_p = 0;
void *pc_p = 0;
- void *restored_cfa = 0;
frame_state saved_ustruct;
int new_eh_model;
int cleanup = 0;
@@ -3789,11 +3788,6 @@ throw_helper (struct eh_context *eh, void *pc, frame_state *my_udata,
pc = saved_pc;
memcpy (udata, my_udata, sizeof (*udata));
- if (udata->cfa_saved)
- /* We saved the CFA register into the stack in this frame, so we
- will restore it in the __throw epilogue. Remember the value. */
- restored_cfa = udata->cfa;
-
while (pc != handler_pc)
{
frame_state *p = udata;
@@ -3814,9 +3808,6 @@ throw_helper (struct eh_context *eh, void *pc, frame_state *my_udata,
copy_reg (i, udata, my_udata);
}
- if (udata->cfa_saved)
- restored_cfa = udata->cfa;
-
pc = get_return_addr (udata, sub_udata) - 1;
}
@@ -3832,13 +3823,6 @@ throw_helper (struct eh_context *eh, void *pc, frame_state *my_udata,
}
/* udata now refers to the frame called by the handler frame. */
- if (my_udata->cfa_saved)
- /* If we saved the CFA register into the stack (after it became the
- CFA register), we'll restore that value into SP in the epilogue,
- as on the ARM. So calculate the adjustment based on the value that
- will be restored. */
- my_udata->cfa = restored_cfa;
-
/* We adjust SP by the difference between __throw's CFA and the CFA for
the frame called by the handler frame, because those CFAs correspond
to the SP values at the two call sites. We need to further adjust by