From 2b50232a5df3dd82d389c4dbcd48940e308605e4 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 1 Jun 2015 08:22:14 +0000 Subject: [PATCH] winnt.c (i386_pe_encode_section_info): Remove obsolete kludge. * config/i386/winnt.c (i386_pe_encode_section_info) : Remove obsolete kludge. ada/ * gcc-interface/utils.c (create_var_decl_1): If an assembler name is specified, let the target mangle it before settting. (create_subprog_decl): Likewise and move this treatment last. From-SVN: r223918 --- gcc/ChangeLog | 5 +++++ gcc/ada/ChangeLog | 6 ++++++ gcc/ada/gcc-interface/utils.c | 22 ++++++++++++++++------ gcc/config/i386/winnt.c | 14 -------------- 4 files changed, 27 insertions(+), 20 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 22af4a9a59e..5d695b59d0f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-06-01 Eric Botcazou + + * config/i386/winnt.c (i386_pe_encode_section_info) : + Remove obsolete kludge. + 2015-06-01 Richard Biener * tree-ssa-reassoc.c (get_rank): Simplify. diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 357f0010bc9..a61837284a4 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2015-06-01 Eric Botcazou + + * gcc-interface/utils.c (create_var_decl_1): If an assembler name is + specified, let the target mangle it before settting. + (create_subprog_decl): Likewise and move this treatment last. + 2015-06-01 Eric Botcazou * gcc-interface/lang-specs.h (TARGET_VXWORKS_RTP): Move substitution to diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 31bb3d254ed..7ec0974f912 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -2428,7 +2428,13 @@ create_var_decl_1 (tree var_name, tree asm_name, tree type, tree var_init, if (TREE_CODE (var_decl) == VAR_DECL) { if (asm_name) - SET_DECL_ASSEMBLER_NAME (var_decl, asm_name); + { + /* Let the target mangle the name if this isn't a verbatim asm. */ + if (*IDENTIFIER_POINTER (asm_name) != '*') + asm_name = targetm.mangle_decl_assembler_name (var_decl, asm_name); + + SET_DECL_ASSEMBLER_NAME (var_decl, asm_name); + } if (global_bindings_p ()) rest_of_decl_compilation (var_decl, true, 0); @@ -3047,8 +3053,17 @@ create_subprog_decl (tree subprog_name, tree asm_name, tree subprog_type, DECL_BY_REFERENCE (result_decl) = TREE_ADDRESSABLE (subprog_type); DECL_RESULT (subprog_decl) = result_decl; + process_attributes (&subprog_decl, &attr_list, true, gnat_node); + + /* Add this decl to the current binding level. */ + gnat_pushdecl (subprog_decl, gnat_node); + if (asm_name) { + /* Let the target mangle the name if this isn't a verbatim asm. */ + if (*IDENTIFIER_POINTER (asm_name) != '*') + asm_name = targetm.mangle_decl_assembler_name (subprog_decl, asm_name); + SET_DECL_ASSEMBLER_NAME (subprog_decl, asm_name); /* The expand_main_function circuitry expects "main_identifier_node" to @@ -3061,11 +3076,6 @@ create_subprog_decl (tree subprog_name, tree asm_name, tree subprog_type, DECL_NAME (subprog_decl) = main_identifier_node; } - process_attributes (&subprog_decl, &attr_list, true, gnat_node); - - /* Add this decl to the current binding level. */ - gnat_pushdecl (subprog_decl, gnat_node); - /* Output the assembler code and/or RTL for the declaration. */ rest_of_decl_compilation (subprog_decl, global_bindings_p (), 0); diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c index da67f5fe5ea..4e07f03c470 100644 --- a/gcc/config/i386/winnt.c +++ b/gcc/config/i386/winnt.c @@ -339,20 +339,6 @@ i386_pe_encode_section_info (tree decl, rtx rtl, int first) switch (TREE_CODE (decl)) { case FUNCTION_DECL: - /* FIXME: Imported stdcall names are not modified by the Ada frontend. - Check and decorate the RTL name now. */ - if (strcmp (lang_hooks.name, "GNU Ada") == 0) - { - tree new_id; - tree old_id = DECL_ASSEMBLER_NAME (decl); - const char* asm_str = IDENTIFIER_POINTER (old_id); - /* Do not change the identifier if a verbatim asmspec - or if stdcall suffix already added. */ - if (!(*asm_str == '*' || strchr (asm_str, '@')) - && (new_id = i386_pe_maybe_mangle_decl_assembler_name (decl, - old_id))) - XSTR (symbol, 0) = IDENTIFIER_POINTER (new_id); - } break; case VAR_DECL: