diff options
author | Geoffrey Keating <geoffk@apple.com> | 2006-02-21 20:36:35 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2006-02-21 20:36:35 +0000 |
commit | 6070e8e5e3237861c3f687a048065090a0455e97 (patch) | |
tree | 2f7c60765bc96cb1b5b95c1c2f17496a7e08b84d /gcc | |
parent | b9bd11ca41d4a61766d028346f3b59e3e88f604c (diff) | |
download | gcc-6070e8e5e3237861c3f687a048065090a0455e97.zip gcc-6070e8e5e3237861c3f687a048065090a0455e97.tar.gz gcc-6070e8e5e3237861c3f687a048065090a0455e97.tar.bz2 |
* config/i386/darwin.h (DWARF2_FRAME_REG_OUT): New.
From-SVN: r111344
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/config/i386/darwin.h | 18 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/eh/spbp.C | 26 |
4 files changed, 47 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1ef4b70..69acf00 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2006-02-21 Geoffrey Keating <geoffk@apple.com> + + * config/i386/darwin.h (DWARF2_FRAME_REG_OUT): New. + 2006-02-21 Alexandre Oliva <aoliva@redhat.com> * config/i386/sse.md (vec_extractv2df_1_sse): New. diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h index b9604e4..c3f9407 100644 --- a/gcc/config/i386/darwin.h +++ b/gcc/config/i386/darwin.h @@ -157,8 +157,16 @@ extern void darwin_x86_file_end (void); 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]) +#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)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 266489f..ff6a6db 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2006-02-21 Geoffrey Keating <geoffk@apple.com> + + * g++.dg/eh/spbp.C: New. + 2006-02-21 Jakub Jelinek <jakub@redhat.com> PR middle-end/26379 diff --git a/gcc/testsuite/g++.dg/eh/spbp.C b/gcc/testsuite/g++.dg/eh/spbp.C new file mode 100644 index 0000000..d9d0130 --- /dev/null +++ b/gcc/testsuite/g++.dg/eh/spbp.C @@ -0,0 +1,26 @@ +/* { 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 (); +} |