This patch replaces a hardcoded "." of local label prefix with
LOCAL_LABEL_PREFIX macro in the ARM backend (generating a "trampoline" in
thumb mode). 

The patch also contains a new test to make sure that the local label
".Ltrampoline_start:" is generated correctly.

No regressions on arm-none-eabi. 



-- Greta



gcc/Changelog:

2011-05-13  Greta Yorsh <greta.yo...@arm.com>

        * config/arm/arm.c: Replace hardcoded "." of local label prefix 
        with LOCAL_LABEL_PREFIX macro.

gcc/testsuite/ChangeLog:

2011-05-13  Greta Yorsh <greta.yo...@arm.com>

        * gcc.target/arm/trampoline-1.c: New test, to make sure 
        the local label ".Ltrampoline" is generated correctly.
        
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 4f9c2aa..6216b49 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -2066,7 +2066,7 @@ arm_asm_trampoline_template (FILE *f)
     {
       ASM_OUTPUT_ALIGN (f, 2);
       fprintf (f, "\t.code\t16\n");
-      fprintf (f, ".Ltrampoline_start:\n");
+      fprintf (f, "%sLtrampoline_start:\n", LOCAL_LABEL_PREFIX);
       asm_fprintf (f, "\tpush\t{r0, r1}\n");
       asm_fprintf (f, "\tldr\tr0, [%r, #8]\n", PC_REGNUM);
       asm_fprintf (f, "\tmov\t%r, r0\n", STATIC_CHAIN_REGNUM);
diff --git a/gcc/testsuite/gcc.target/arm/trampoline-1.c 
b/gcc/testsuite/gcc.target/arm/trampoline-1.c
new file mode 100644
index 0000000..212e7ee
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/trampoline-1.c
@@ -0,0 +1,19 @@
+/* { dg-options "-mcpu=arm7tdmi -mthumb" }  */
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_eabi } */
+/* { dg-require-effective-target arm_thumb1_ok } */
+
+void
+foo(int a) 
+{  
+  int
+  gee(void)
+  {
+    return a;
+  }
+  extern int bar(int (*)(void));
+  bar(&gee);
+  
+}
+
+/* { dg-final { scan-assembler ".Ltrampoline_start:" } } */ 

Reply via email to