+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.
{
/* 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;
{
/* 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;
{
/* 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;
{
/* 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;
--- /dev/null
+/* { 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
+