diff mbox

[ARM] interrupt testcases for shink-wrapping

Message ID CACgzC7CYt17_m-TpzuMPYXOyJ9AbEq2uKd4sOVFkY57KxhA+3w@mail.gmail.com
State New
Headers show

Commit Message

Zhenqiang Chen May 27, 2014, 8:07 a.m. UTC
Hi,

Following up Richard's comments:
https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00967.html

I investigate interrupt routines:
* gcc can shrink-wrapping an interrupt routine (ARM mode). The
shrink-wrap-interrupt_1.c in the patch can show it.
* There is restriction for interrupt routine to be shrink-wrapped.
e.g. shrink-wrap-interrupt_2.c can not be shrink-wrapped.
* When interrupt routine is shrink-wrapped, it uses
"*cond_simple_return" to return from the function. There is no dwarf
info issue.

So no need to change the codes. The patch only includes two test cases
to track it.

OK for trunk?

Thanks!
-Zhenqiang

testsuite/ChangeLog:
2014-05-27  Zhenqiang Chen  <zhenqiang.chen@linaro.org>

        * gcc.target/arm/shrink-wrap-interrupt_1.c: New test.
        * gcc.target/arm/shrink-wrap-interrupt_2.c: New test.

+/* { dg-final { cleanup-rtl-dump "pro_and_epilogue" } } */

Comments

Jeff Law May 27, 2014, 3:22 p.m. UTC | #1
On 05/27/14 02:07, Zhenqiang Chen wrote:
> Hi,
>
> Following up Richard's comments:
> https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00967.html
>
> I investigate interrupt routines:
> * gcc can shrink-wrapping an interrupt routine (ARM mode). The
> shrink-wrap-interrupt_1.c in the patch can show it.
> * There is restriction for interrupt routine to be shrink-wrapped.
> e.g. shrink-wrap-interrupt_2.c can not be shrink-wrapped.
> * When interrupt routine is shrink-wrapped, it uses
> "*cond_simple_return" to return from the function. There is no dwarf
> info issue.
>
> So no need to change the codes. The patch only includes two test cases
> to track it.
>
> OK for trunk?
>
> Thanks!
> -Zhenqiang
>
> testsuite/ChangeLog:
> 2014-05-27  Zhenqiang Chen  <zhenqiang.chen@linaro.org>
>
>          * gcc.target/arm/shrink-wrap-interrupt_1.c: New test.
>          * gcc.target/arm/shrink-wrap-interrupt_2.c: New test.
OK.
Jeff
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.target/arm/shrink-wrap-interrupt_1.c
b/gcc/testsuite/gcc.target/arm/shrink-wrap-interrupt_1.c
new file mode 100644
index 0000000..3432115
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/shrink-wrap-interrupt_1.c
@@ -0,0 +1,24 @@ 
+/* Verify that shrink-wrapping works for functions
+   with __attribute__ ((interrupt)).  */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_nothumb } */
+/* { dg-options "-O2 -marm -mapcs -fdump-rtl-pro_and_epilogue" } */
+
+/* This test is not valid when -mthumb.  */
+
+extern void test (int, int) __attribute__ ((interrupt ("IRQ")));
+int p;
+
+void
+test (int a, int b)
+{
+  if (a > b)
+  {
+    p = a + 0x123456;
+    p = p * (b - 0x9879876);
+  }
+}
+
+/* { dg-final { scan-rtl-dump "Performing shrink-wrapping"
"pro_and_epilogue"  } } */
+/* { dg-final { cleanup-rtl-dump "pro_and_epilogue" } } */
diff --git a/gcc/testsuite/gcc.target/arm/shrink-wrap-interrupt_2.c
b/gcc/testsuite/gcc.target/arm/shrink-wrap-interrupt_2.c
new file mode 100644
index 0000000..ecb793e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/shrink-wrap-interrupt_2.c
@@ -0,0 +1,24 @@ 
+/* Verify that shrink-wrapping works for functions
+   with __attribute__ ((interrupt)).  */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_nothumb } */
+/* { dg-options "-O2 -marm -mapcs -fdump-rtl-pro_and_epilogue" } */
+
+/* This test is not valid when -mthumb.  */
+
+extern void test (int, int) __attribute__ ((interrupt ("IRQ")));
+int p;
+
+void
+test (int a, int b)
+{
+  if (a)
+  {
+    p = a + 0x123456;
+    p = p * (b - 0x9879876);
+  }
+}
+
+/* { dg-final { scan-rtl-dump-not "Performing shrink-wrapping"
"pro_and_epilogue"  } } */