aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@apple.com>2006-02-21 22:14:23 +0000
committerGeoffrey Keating <geoffk@apple.com>2006-02-21 22:14:23 +0000
commit75750869828f74684d6cd0ec30cca116c20d93e6 (patch)
tree0fec2c9c0d114bbcabbd2072021eea2e078fa7b0
parent54a10b6c3c79990a10ef0e259aa166bfa438b6f5 (diff)
Index: ChangeLog
2006-02-21 Geoffrey Keating <geoffk@apple.com> Radar 4439051 * config/i386/darwin.h (DWARF2_FRAME_REG_OUT): New. Index: testsuite/ChangeLog 2006-02-21 Geoffrey Keating <geoffk@apple.com> Radar 4439051 * g++.dg/eh/spbp.C: New. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/apple-local-200502-branch@111346 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/i386/darwin.h22
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/eh/spbp.C27
4 files changed, 52 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 03f770d7fc2..f3bbf58386d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2006-02-21 Geoffrey Keating <geoffk@apple.com>
+
+ Radar 4439051
+ * config/i386/darwin.h (DWARF2_FRAME_REG_OUT): New.
+
2006-02-13 Geoffrey Keating <geoffk@apple.com>
Radar 4433453
diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h
index c9d566952f9..fd2c3376424 100644
--- a/gcc/config/i386/darwin.h
+++ b/gcc/config/i386/darwin.h
@@ -256,14 +256,22 @@ extern int flag_cw_asm_blocks;
#define CW_ASM_REGISTER_NAME(STR, BUF) i386_cw_asm_register_name (STR, BUF)
/* APPLE LOCAL end CW asm blocks */
-/* APPLE LOCAL begin mainline 2006-02-10 4439051 */
+/* APPLE LOCAL begin mainline 2006-02-21 4439051 */
/* Darwin uses the standard DWARF register numbers but the default
register numbers for STABS. Fortunately for 64-bit code the
default and the standard are the same. */
#undef DBX_REGISTER_NUMBER
-#define DBX_REGISTER_NUMBER(n) (TARGET_64BIT \
- ? dbx64_register_map[n] \
- : write_symbols == DWARF2_DEBUG \
- ? svr4_dbx_register_map[n] \
- : dbx_register_map[n])
-/* APPLE LOCAL end mainline 2006-02-10 4439051 */
+#define DBX_REGISTER_NUMBER(n) \
+ (TARGET_64BIT ? dbx64_register_map[n] \
+ : write_symbols == DWARF2_DEBUG ? svr4_dbx_register_map[n] \
+ : dbx_register_map[n])
+
+/* Unfortunately, the 32-bit EH information also doesn't use the standard
+ DWARF register numbers. */
+#define DWARF2_FRAME_REG_OUT(n, for_eh) \
+ (! (for_eh) || write_symbols != DWARF2_DEBUG || TARGET_64BIT ? (n) \
+ : (n) == 5 ? 4 \
+ : (n) == 4 ? 5 \
+ : (n) >= 11 && (n) <= 18 ? (n) + 1 \
+ : (n))
+/* APPLE LOCAL end mainline 2006-02-21 4439051 */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0b2b238b15b..2328abac599 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2006-02-21 Geoffrey Keating <geoffk@apple.com>
+
+ Radar 4439051
+ * g++.dg/eh/spbp.C: New.
+
2006-01-21 Mark Mitchell <mark@codesourcery.com>
PR c++/25895
diff --git a/gcc/testsuite/g++.dg/eh/spbp.C b/gcc/testsuite/g++.dg/eh/spbp.C
new file mode 100644
index 00000000000..cb1f9088b27
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/spbp.C
@@ -0,0 +1,27 @@
+/* APPLE LOCAL file mainline 2005-02-21 4439051 */
+/* { dg-do run } */
+/* { dg-options "-gdwarf-2" } */
+
+/* This was a bug on x86-darwin, where the register numbering for SP
+ and BP was swapped (it's easy to do because on that port it's
+ different for eh_frame and debug_frame). */
+
+#include <stdlib.h>
+
+void f1(int t)
+{
+ char u[t];
+ throw 1;
+}
+
+int main()
+{
+ bool b = true;
+ try {
+ f1(100);
+ } catch (int x) {
+ if (b)
+ exit (0);
+ }
+ abort ();
+}