diff options
author | Mark Shinwell <shinwell@codesourcery.com> | 2006-08-21 10:10:58 +0000 |
---|---|---|
committer | Mark Shinwell <shinwell@gcc.gnu.org> | 2006-08-21 10:10:58 +0000 |
commit | 08a557f68225a22e690482ab7c1671231d96b2ac (patch) | |
tree | 64512c7e3821c3ff89a5a5bcd03debbfc3c16aa5 | |
parent | 1af4bba82ed51ba8108d40badd3d39204f810838 (diff) | |
download | gcc-08a557f68225a22e690482ab7c1671231d96b2ac.zip gcc-08a557f68225a22e690482ab7c1671231d96b2ac.tar.gz gcc-08a557f68225a22e690482ab7c1671231d96b2ac.tar.bz2 |
pr-support.c (__gnu_unwind_execute): Insert " + 1" in necessary places to pass the correct "number of registers"...
gcc/
* config/arm/pr-support.c (__gnu_unwind_execute): Insert " + 1" in
necessary places to pass the correct "number of registers" values
to _Unwind_VRS_Pop.
gcc/testsuite/
* g++.dg/eh/arm-vfp-unwind.C: New test.
From-SVN: r116291
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/arm/pr-support.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/eh/arm-vfp-unwind.C | 40 |
4 files changed, 54 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bb37d46..b0143f7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2006-08-21 Mark Shinwell <shinwell@codesourcery.com> + + * config/arm/pr-support.c (__gnu_unwind_execute): Insert " + 1" in + necessary places to pass the correct "number of registers" values + to _Unwind_VRS_Pop. + 2006-08-20 Jan Hubicka <jh@suse.cz> * tree-ssa-alias.c (eq_ptr_info, ptr_info_hash): New function. diff --git a/gcc/config/arm/pr-support.c b/gcc/config/arm/pr-support.c index 072b4a9..0e750bf 100644 --- a/gcc/config/arm/pr-support.c +++ b/gcc/config/arm/pr-support.c @@ -224,7 +224,7 @@ __gnu_unwind_execute (_Unwind_Context * context, __gnu_unwind_state * uws) { /* Pop VFP registers with fldmx. */ op = next_unwind_byte (uws); - op = ((op & 0xf0) << 12) | (op & 0xf); + op = ((op & 0xf0) << 12) | ((op & 0xf) + 1); if (_Unwind_VRS_Pop (context, _UVRSC_VFP, op, _UVRSD_VFPX) != _UVRSR_OK) return _URC_FAILURE; @@ -253,7 +253,7 @@ __gnu_unwind_execute (_Unwind_Context * context, __gnu_unwind_state * uws) { /* Pop iWMMXt D registers. */ op = next_unwind_byte (uws); - op = ((op & 0xf0) << 12) | (op & 0xf); + op = ((op & 0xf0) << 12) | ((op & 0xf) + 1); if (_Unwind_VRS_Pop (context, _UVRSC_WMMXD, op, _UVRSD_UINT64) != _UVRSR_OK) return _URC_FAILURE; @@ -284,7 +284,7 @@ __gnu_unwind_execute (_Unwind_Context * context, __gnu_unwind_state * uws) { /* Pop FPA registers. */ op = next_unwind_byte (uws); - op = ((op & 0xf0) << 12) | (op & 0xf); + op = ((op & 0xf0) << 12) | ((op & 0xf) + 1); if (_Unwind_VRS_Pop (context, _UVRSC_FPA, op, _UVRSD_FPAX) != _UVRSR_OK) return _URC_FAILURE; @@ -294,7 +294,7 @@ __gnu_unwind_execute (_Unwind_Context * context, __gnu_unwind_state * uws) { /* Pop VFP registers with fldmd. */ op = next_unwind_byte (uws); - op = ((op & 0xf0) << 12) | (op & 0xf); + op = ((op & 0xf0) << 12) | ((op & 0xf) + 1); if (_Unwind_VRS_Pop (context, _UVRSC_VFP, op, _UVRSD_DOUBLE) != _UVRSR_OK) return _URC_FAILURE; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bc920d0..0f92e5f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2006-08-21 Mark Shinwell <shinwell@codesourcery.com> + + * g++.dg/eh/arm-vfp-unwind.C: New test. + 2006-08-20 Mark Mitchell <mark@codesourcery.com> PR c++/28341 diff --git a/gcc/testsuite/g++.dg/eh/arm-vfp-unwind.C b/gcc/testsuite/g++.dg/eh/arm-vfp-unwind.C new file mode 100644 index 0000000..94b53b59 --- /dev/null +++ b/gcc/testsuite/g++.dg/eh/arm-vfp-unwind.C @@ -0,0 +1,40 @@ +/* { dg-require-effective-target arm32 } */ +/* { dg-do run } */ + +/* Test to catch off-by-one errors in arm/pr-support.c. */ + +#if defined (__VFP_FP__) && !defined (__SOFTFP__) + +#include <iostream> +#include <stdlib.h> + +using namespace std; + +static void donkey () +{ + asm volatile ("fcpyd d9, %P0" : : "w" (1.2345) : "d9"); + throw 1; +} + +int main() +{ + try + { + donkey (); + } + catch (int foo) + { + return 0; + } + return 1; +} + +#else + +int main() +{ + return 0; +} + +#endif + |