aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 9a40bd1f9d4..f0f27b95933 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA. */
line numbers. For example, the CONST_DECLs for enum values. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "tree.h"
#include "flags.h"
#include "output.h"
@@ -1884,10 +1884,17 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
if (DECL_SECTION_NAME (newdecl) == NULL_TREE)
DECL_SECTION_NAME (newdecl) = DECL_SECTION_NAME (olddecl);
+ /* Copy the assembler name.
+ Currently, it can only be defined in the prototype. */
+ DECL_ASSEMBLER_NAME (newdecl) = DECL_ASSEMBLER_NAME (olddecl);
+
if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
DECL_STATIC_CONSTRUCTOR(newdecl) |= DECL_STATIC_CONSTRUCTOR(olddecl);
DECL_STATIC_DESTRUCTOR (newdecl) |= DECL_STATIC_DESTRUCTOR (olddecl);
+
+ DECL_NO_CHECK_MEMORY_USAGE (newdecl)
+ |= DECL_NO_CHECK_MEMORY_USAGE (olddecl);
}
pop_obstacks ();
@@ -3936,6 +3943,7 @@ finish_decl (decl, init, asmspec_tree)
{
DECL_BUILT_IN (decl) = 0;
DECL_RTL (decl) = 0;
+ DECL_ASSEMBLER_NAME (decl) = get_identifier (asmspec);
}
/* Output the assembler code and/or RTL code for variables and functions,
@@ -7183,7 +7191,8 @@ finish_function (nested)
static_ctors = perm_tree_cons (NULL_TREE, fndecl, static_ctors);
else
#endif
- assemble_constructor (IDENTIFIER_POINTER (DECL_NAME (fndecl)));
+ assemble_constructor (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl)));
+
}
if (DECL_STATIC_DESTRUCTOR (fndecl))
{
@@ -7192,7 +7201,7 @@ finish_function (nested)
static_dtors = perm_tree_cons (NULL_TREE, fndecl, static_dtors);
else
#endif
- assemble_destructor (IDENTIFIER_POINTER (DECL_NAME (fndecl)));
+ assemble_destructor (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl)));
}
if (! nested)