aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorJ"orn Rennecke <joern.rennecke@superh.com>2003-05-19 16:41:47 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>2003-05-19 17:41:47 +0100
commit52a8b7b838128c142fdf8d26ae1d7f073797a7fa (patch)
tree219e6459fd9b5f94e6d100d20d4910605ee52a48 /gcc/c-decl.c
parent68594ce757081d3fc7b7b7eaee1e4651d17d0d86 (diff)
downloadgcc-52a8b7b838128c142fdf8d26ae1d7f073797a7fa.zip
gcc-52a8b7b838128c142fdf8d26ae1d7f073797a7fa.tar.gz
gcc-52a8b7b838128c142fdf8d26ae1d7f073797a7fa.tar.bz2
c-decl.c (finish_decl): When setting the DECL_ASSEMBLER_NAME of a function using ASMSPEC, prepend a star.
* c-decl.c (finish_decl): When setting the DECL_ASSEMBLER_NAME of a function using ASMSPEC, prepend a star. From-SVN: r66965
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 28ba643..f6e6f5b 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -2874,25 +2874,31 @@ finish_decl (decl, init, asmspec_tree)
was a normal built-in. */
if (TREE_CODE (decl) == FUNCTION_DECL && asmspec)
{
+ /* ASMSPEC is given, and not the name of a register. Mark the
+ name with a star so assemble_name won't munge it. */
+ char *starred = alloca (strlen (asmspec) + 2);
+ starred[0] = '*';
+ strcpy (starred + 1, asmspec);
+
if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
{
tree builtin = built_in_decls [DECL_FUNCTION_CODE (decl)];
SET_DECL_RTL (builtin, NULL_RTX);
- SET_DECL_ASSEMBLER_NAME (builtin, get_identifier (asmspec));
+ SET_DECL_ASSEMBLER_NAME (builtin, get_identifier (starred));
#ifdef TARGET_MEM_FUNCTIONS
if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMCPY)
- init_block_move_fn (asmspec);
+ init_block_move_fn (starred);
else if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMSET)
- init_block_clear_fn (asmspec);
+ init_block_clear_fn (starred);
#else
if (DECL_FUNCTION_CODE (decl) == BUILT_IN_BCOPY)
- init_block_move_fn (asmspec);
+ init_block_move_fn (starred);
else if (DECL_FUNCTION_CODE (decl) == BUILT_IN_BZERO)
- init_block_clear_fn (asmspec);
+ init_block_clear_fn (starred);
#endif
}
SET_DECL_RTL (decl, NULL_RTX);
- SET_DECL_ASSEMBLER_NAME (decl, get_identifier (asmspec));
+ SET_DECL_ASSEMBLER_NAME (decl, get_identifier (starred));
}
/* Output the assembler code and/or RTL code for variables and functions,