Commit 8f820299 by Zack Weinberg Committed by Zack Weinberg

varasm.c (make_decl_rtl): Restore leading star on DECL_ASSEMBLER_NAME set for…

varasm.c (make_decl_rtl): Restore leading star on DECL_ASSEMBLER_NAME set for decls with an asmspec.

	* varasm.c (make_decl_rtl): Restore leading star on
	DECL_ASSEMBLER_NAME set for decls with an asmspec.
	* gcc.dg/asm-names.c: New test.

From-SVN: r36309
parent 4337bc93
2000-09-10 Zack Weinberg <zack@wolery.cumb.org>
* varasm.c (make_decl_rtl): Restore leading star on
DECL_ASSEMBLER_NAME set for decls with an asmspec.
2000-09-10 Zack Weinberg <zack@wolery.cumb.org>
* c-pragma.c (handle_pragma_pack): Correct parsing logic so it
won't give a spurious error for '#pragma pack()'. Simplify
control flow for readability. 'reset' action is not necessary.
......
2000-09-10 Zack Weinberg <zack@wolery.cumb.org>
* gcc.dg/asm-names.c: New test.
2000-09-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/cpp/tr-warn6.c: New test
......
/* The name specified by an asm("...") suffix on a declaration is not
to have an underscore prefixed, even if normal symbols are.
Problem reported by Krister Walfridsson <cato@df.lth.se>. */
/* { dg-do link } */
/* { dg-options "-fleading-underscore" } */
extern void frobnicate (void) asm ("___frob14"); /* three underscores */
void __frob14 (void) {} /* two underscores */
int
main (void)
{
frobnicate ();
return 0;
}
/* In case built where the runtime expects no leading underscore on
main(). */
extern int xmain (void) asm ("main");
int xmain (void) { return main(); }
......@@ -710,8 +710,14 @@ make_decl_rtl (decl, asmspec, top_level)
reg_number = decode_reg_name (asmspec);
if (reg_number == -2)
/* ASMSPEC is given, and not the name of a register. */
new_name = 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);
new_name = starred;
}
if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment