From: Danny Smith Date: Tue, 2 Dec 2008 08:02:07 +0000 (+0000) Subject: re PR target/38054 (Assertion failed in change_decl_assembler_name()) X-Git-Tag: releases/gcc-4.4.0~1417 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bfb139b409e012903a3faf0c6934792cc7d2a838;p=thirdparty%2Fgcc.git re PR target/38054 (Assertion failed in change_decl_assembler_name()) PR target/38054 * config/i386/winnt.c (i386_pe_encode_section_info): Condition stdcall decoration of function RTL names here on Ada language. From-SVN: r142347 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 33a076943ee4..75fa2e759ca7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-12-02 Danny Smith + + PR target/38054 + * config/i386/winnt.c (i386_pe_encode_section_info): Condition stdcall + decoration of function RTL names here on Ada language. + 2008-12-01 Vladimir Makarov PR rtl-optimization/38280 diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c index 7815be007a88..48b82131d3fc 100644 --- a/gcc/config/i386/winnt.c +++ b/gcc/config/i386/winnt.c @@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see #include "tm_p.h" #include "toplev.h" #include "hashtab.h" +#include "langhooks.h" #include "ggc.h" #include "target.h" @@ -258,27 +259,19 @@ i386_pe_encode_section_info (tree decl, rtx rtl, int first) switch (TREE_CODE (decl)) { case FUNCTION_DECL: - if (first) + /* 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) { - /* FIXME: In Ada, and perhaps other language frontends, - imported stdcall names may not yet have been modified. - Check and do it know. */ - 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 + 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, '@')) - break; - if ((new_id = i386_pe_maybe_mangle_decl_assembler_name (decl, old_id))) - { - /* These attributes must be present on first declaration, - change_decl_assembler_name will warn if they are added - later and the decl has been referenced, but duplicate_decls - should catch the mismatch first. */ - change_decl_assembler_name (decl, new_id); - XSTR (symbol, 0) = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); - } + 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;