From patchwork Fri May 20 10:13:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: cleanup: local label prefix Date: Fri, 20 May 2011 00:13:46 -0000 From: Greta Yorsh X-Patchwork-Id: 96578 Message-Id: <000001cc16d6$9b6ac560$d2405020$@Yorsh@arm.com> To: 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 * config/arm/arm.c: Replace hardcoded "." of local label prefix with LOCAL_LABEL_PREFIX macro. gcc/testsuite/ChangeLog: 2011-05-13 Greta Yorsh * 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:" } } */