aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-09-30 01:21:27 -0700
committerRichard Henderson <rth@gcc.gnu.org>2004-09-30 01:21:27 -0700
commit282efe1c41e928262612d9c6291805a21f50906f (patch)
treeb68f70cabfd53a484ae0dea743781e11afb3cfd7 /gcc
parentde39930392eda3a8a298e70d07f997eba84c5afe (diff)
downloadgcc-282efe1c41e928262612d9c6291805a21f50906f.zip
gcc-282efe1c41e928262612d9c6291805a21f50906f.tar.gz
gcc-282efe1c41e928262612d9c6291805a21f50906f.tar.bz2
unwind-dw2.c (_Unwind_GetGR): Honor DWARF_ZERO_REG.
* unwind-dw2.c (_Unwind_GetGR): Honor DWARF_ZERO_REG. * doc/tm.texi (DWARF_ZERO_REG): New. * config/alpha/alpha.c (alpha_sa_mask, alpha_expand_prologue, alpha_expand_epilogue): Revert 2003-09-30 change to store zero. * config/alpha/alpha.h (DWARF_ZERO_REG): New. From-SVN: r88331
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/alpha/alpha.c16
-rw-r--r--gcc/config/alpha/alpha.h1
-rw-r--r--gcc/doc/tm.texi8
-rw-r--r--gcc/unwind-dw2.c5
5 files changed, 23 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8f4b396..7dfe5e8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2004-09-29 Richard Henderson <rth@redhat.com>
+
+ * unwind-dw2.c (_Unwind_GetGR): Honor DWARF_ZERO_REG.
+ * doc/tm.texi (DWARF_ZERO_REG): New.
+
+ * config/alpha/alpha.c (alpha_sa_mask, alpha_expand_prologue,
+ alpha_expand_epilogue): Revert 2003-09-30 change to store zero.
+ * config/alpha/alpha.h (DWARF_ZERO_REG): New.
+
2004-09-29 Ulrich Weigand <uweigand@de.ibm.com>
* builtins.c (expand_builtin_strlen): Do not call emit_move_insn
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 114170b..b1de390 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -5924,11 +5924,6 @@ alpha_sa_mask (unsigned long *imaskP, unsigned long *fmaskP)
break;
imask |= 1UL << regno;
}
-
- /* Glibc likes to use $31 as an unwind stopper for crt0. To
- avoid hackery in unwind-dw2.c, we need to actively store a
- zero in the prologue of _Unwind_RaiseException et al. */
- imask |= 1UL << 31;
}
/* If any register spilled, then spill the return address also. */
@@ -6451,14 +6446,6 @@ alpha_expand_prologue (void)
reg_offset += 8;
}
- /* Store a zero if requested for unwinding. */
- if (imask & (1UL << 31))
- {
- emit_frame_store_1 (const0_rtx, sa_reg, sa_bias, reg_offset,
- gen_rtx_REG (Pmode, 31));
- reg_offset += 8;
- }
-
for (i = 0; i < 31; i++)
if (fmask & (1UL << i))
{
@@ -6876,9 +6863,6 @@ alpha_expand_epilogue (void)
reg_offset += 8;
}
- if (imask & (1UL << 31))
- reg_offset += 8;
-
for (i = 0; i < 31; ++i)
if (fmask & (1UL << i))
{
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index 35d6f4a..fe3cedc 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -1183,6 +1183,7 @@ do { \
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, 26)
#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (26)
#define DWARF_ALT_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (64)
+#define DWARF_ZERO_REG 31
/* Describe how we implement __builtin_eh_return. */
#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 16 : INVALID_REGNUM)
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index fc033ec..f72713c 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -2974,6 +2974,14 @@ general register, but an alternate column needs to be used for
signal frames.
@end defmac
+@defmac DWARF_ZERO_REG
+A C expression whose value is an integer giving a DWARF 2 register
+number that is considered to always have the value zero. This should
+only be defined if the target has an architected zero register, and
+someone decided it was a good idea to use that register number to
+terminate the stack backtrace. New ports should avoid this.
+@end defmac
+
@defmac INCOMING_FRAME_SP_OFFSET
A C expression whose value is an integer giving the offset, in bytes,
from the value of the stack pointer register to the top of the stack
diff --git a/gcc/unwind-dw2.c b/gcc/unwind-dw2.c
index 67b8d1c..baa4481 100644
--- a/gcc/unwind-dw2.c
+++ b/gcc/unwind-dw2.c
@@ -125,6 +125,11 @@ _Unwind_GetGR (struct _Unwind_Context *context, int index)
int size;
void *ptr;
+#ifdef DWARF_ZERO_REG
+ if (index == DWARF_ZERO_REG)
+ return 0;
+#endif
+
index = DWARF_REG_TO_UNWIND_COLUMN (index);
if (index >= (int) sizeof(dwarf_reg_size_table))
abort ();