summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/arm/arm.c9
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/nested-func-5.c13
4 files changed, 32 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 515e4f97d21..030f172173d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-19 Paul Brook <paul@codesourcery.com>
+
+ PR target/28516
+ * config/arm/arm.c (arm_unwind_emit_set): Handle reg = sp + const.
+
2006-09-17 Zdenek Dvorak <dvorakz@suse.cz>
PR tree-optimization/28887
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index a36c0d79176..ff5831f4325 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -15415,6 +15415,15 @@ arm_unwind_emit_set (FILE * asm_out_file, rtx p)
/* Move from sp to reg. */
asm_fprintf (asm_out_file, "\t.movsp %r\n", REGNO (e0));
}
+ else if (GET_CODE (e1) == PLUS
+ && GET_CODE (XEXP (e1, 0)) == REG
+ && REGNO (XEXP (e1, 0)) == SP_REGNUM
+ && GET_CODE (XEXP (e1, 1)) == CONST_INT)
+ {
+ /* Set reg to offset from sp. */
+ asm_fprintf (asm_out_file, "\t.movsp %r, #%d\n",
+ REGNO (e0), (int)INTVAL(XEXP (e1, 1)));
+ }
else
abort ();
break;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f5d9a7a452c..e643d1d5001 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-19 Paul Brook <paul@codesourcery.com>
+
+ PR target/28516
+ * gcc.dg/nested-func-5.c: New test.
+
2006-09-19 Ben Elliston <bje@au.ibm.com>
* lib/target-supports.exp (check_effective_target_tls): Compile
diff --git a/gcc/testsuite/gcc.dg/nested-func-5.c b/gcc/testsuite/gcc.dg/nested-func-5.c
new file mode 100644
index 00000000000..5076dbd5049
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/nested-func-5.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fexceptions" } */
+/* PR28516: ICE generating ARM unwind directives for nested functions. */
+
+void ex(int (*)(void));
+void foo(int i)
+{
+ int bar(void)
+ {
+ return i;
+ }
+ ex(bar);
+}