aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2008-12-02 08:02:07 +0000
committerDanny Smith <dannysmith@gcc.gnu.org>2008-12-02 08:02:07 +0000
commitbfb139b409e012903a3faf0c6934792cc7d2a838 (patch)
tree5109a690c950cbf8364dcb1f6d0ab07d968cede6 /gcc
parenta40fff0edbfec21b0e4cda87e3a8be26b0970f72 (diff)
downloadgcc-bfb139b409e012903a3faf0c6934792cc7d2a838.zip
gcc-bfb139b409e012903a3faf0c6934792cc7d2a838.tar.gz
gcc-bfb139b409e012903a3faf0c6934792cc7d2a838.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/i386/winnt.c31
2 files changed, 18 insertions, 19 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 33a0769..75fa2e7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2008-12-02 Danny Smith <dannysmith@users.sourceforge.net>
+
+ 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 <vmakarov@redhat.com>
PR rtl-optimization/38280
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index 7815be0..48b8213 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;