]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/38054 (Assertion failed in change_decl_assembler_name())
authorDanny Smith <dannysmith@users.sourceforge.net>
Tue, 2 Dec 2008 08:02:07 +0000 (08:02 +0000)
committerDanny Smith <dannysmith@gcc.gnu.org>
Tue, 2 Dec 2008 08:02:07 +0000 (08:02 +0000)
        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

gcc/ChangeLog
gcc/config/i386/winnt.c

index 33a076943ee479d9c0be6d97e1dd16dac06a24a2..75fa2e759ca77035735cbfab13a4847599ca1b21 100644 (file)
@@ -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
index 7815be007a88aafec1f34f3a7cc872f92da2cf23..48b82131d3fc0b6e717a01c9da3fd39719d53922 100644 (file)
@@ -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;