aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/arm/arm.c3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/arm/interrupt-1.c23
-rw-r--r--gcc/testsuite/gcc.target/arm/interrupt-2.c26
5 files changed, 61 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 47a87af..5a446a9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-12 Jie Zhang <jie@codesourcery.com>
+
+ * config/arm/arm.c (arm_get_frame_offsets): Don't use r3 to
+ align the stack when it's going to be saved.
+
2010-07-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR pch/14940
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index db4f701..aa0f9cc 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -14691,7 +14691,8 @@ arm_get_frame_offsets (void)
generates better code on Thumb-2 by avoiding the need to
use 32-bit push/pop instructions. */
if (!crtl->tail_call_emit
- && arm_size_return_regs () <= 12)
+ && arm_size_return_regs () <= 12
+ && (offsets->saved_regs_mask & (1 << 3)) == 0)
{
reg = 3;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5957c70..7d0fb14 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-12 Jie Zhang <jie@codesourcery.com>
+
+ * gcc.target/arm/interrupt-1.c: New test.
+ * gcc.target/arm/interrupt-2.c: New test.
+
2010-07-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* gcc.dg/pr42427.c: Require c99_runtime.
diff --git a/gcc/testsuite/gcc.target/arm/interrupt-1.c b/gcc/testsuite/gcc.target/arm/interrupt-1.c
new file mode 100644
index 0000000..18379de
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/interrupt-1.c
@@ -0,0 +1,23 @@
+/* Verify that prologue and epilogue are correct for functions with
+ __attribute__ ((interrupt)). */
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+
+/* This test is not valid when -mthumb. We just cheat. */
+#ifndef __thumb__
+extern void bar (int);
+extern void foo (void) __attribute__ ((interrupt("IRQ")));
+
+void foo ()
+{
+ bar (0);
+}
+#else
+void foo ()
+{
+ asm ("stmfd\tsp!, {r0, r1, r2, r3, r4, fp, ip, lr}");
+ asm ("ldmfd\tsp!, {r0, r1, r2, r3, r4, fp, ip, pc}^");
+}
+#endif
+/* { dg-final { scan-assembler "stmfd\tsp!, {r0, r1, r2, r3, r4, fp, ip, lr}" } } */
+/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, fp, ip, pc}\\^" } } */
diff --git a/gcc/testsuite/gcc.target/arm/interrupt-2.c b/gcc/testsuite/gcc.target/arm/interrupt-2.c
new file mode 100644
index 0000000..b979bf1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/interrupt-2.c
@@ -0,0 +1,26 @@
+/* Verify that prologue and epilogue are correct for functions with
+ __attribute__ ((interrupt)). */
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+/* This test is not valid when -mthum. We just cheat. */
+#ifndef __thumb__
+extern void bar (int);
+extern void test (void) __attribute__((__interrupt__));
+
+int foo;
+void test()
+{
+ funcptrs(foo);
+ foo = 0;
+}
+#else
+void test ()
+{
+ asm ("stmfd\tsp!, {r0, r1, r2, r3, r4, r5, ip, lr}");
+ asm ("ldmfd\tsp!, {r0, r1, r2, r3, r4, r5, ip, pc}^");
+}
+#endif
+
+/* { dg-final { scan-assembler "stmfd\tsp!, {r0, r1, r2, r3, r4, r5, ip, lr}" } } */
+/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, r5, ip, pc}\\^" } } */