diff mbox

[i386,windows] : Fix regression about name-decoration

Message ID CAEwic4bCscPtOJz1BtdZMibqba1_CM9A7iRLQmhvuWCV2Z86Qw@mail.gmail.com
State New
Headers show

Commit Message

Kai Tietz Nov. 20, 2012, 10:25 a.m. UTC
Hi,

This patch fixes a regression introduced by rev. 193204 for all 32-bit
Windows targets.
It corrects the wrong assumption in i386.c to be able to simply
undefine TARGET_MANGLE_DECL_ASSEMBLER_NAME
there without keeping care to call sub-target specific hook.  This
destroyed name-decoration for
stdcall and fastcall calling conventions.

ChangeLog

2012-11-20  Kai Tietz

	PR target/55268
	* i386.c (ix86_mangle_decl_assembler_name): Use
	SUBTARGET_MANGLE_DECL_ASSEMBLER_NAME if defined.
	* cygming.h (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Rename
	to SUBTARGET_MANGLE_DECL_ASSEMBLER_NAME.

Tested for i686-w64-mingw32, i686-pc-cygwin, and x86_64-w64-mingw32.
Ok for apply?

Regards,
Kai

Comments

Richard Henderson Nov. 20, 2012, 3:48 p.m. UTC | #1
On 11/20/2012 02:25 AM, Kai Tietz wrote:
> 2012-11-20  Kai Tietz
> 
> 	PR target/55268
> 	* i386.c (ix86_mangle_decl_assembler_name): Use
> 	SUBTARGET_MANGLE_DECL_ASSEMBLER_NAME if defined.
> 	* cygming.h (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Rename
> 	to SUBTARGET_MANGLE_DECL_ASSEMBLER_NAME.

Ok.


r~
diff mbox

Patch

Index: cygming.h
===================================================================
--- cygming.h	(Revision 193650)
+++ cygming.h	(Arbeitskopie)
@@ -471,7 +471,7 @@ 

 #define TARGET_VALID_DLLIMPORT_ATTRIBUTE_P i386_pe_valid_dllimport_attribute_p
 #define TARGET_CXX_ADJUST_CLASS_AT_DEFINITION
i386_pe_adjust_class_at_definition
-#define TARGET_MANGLE_DECL_ASSEMBLER_NAME i386_pe_mangle_decl_assembler_name
+#define SUBTARGET_MANGLE_DECL_ASSEMBLER_NAME i386_pe_mangle_decl_assembler_name

 #undef TARGET_ASM_ASSEMBLE_VISIBILITY
 #define TARGET_ASM_ASSEMBLE_VISIBILITY i386_pe_assemble_visibility
Index: i386.c
===================================================================
--- i386.c	(Revision 193650)
+++ i386.c	(Arbeitskopie)
@@ -28981,7 +28981,10 @@ 
   /* For function version, add the target suffix to the assembler name.  */
   if (TREE_CODE (decl) == FUNCTION_DECL
       && DECL_FUNCTION_VERSIONED (decl))
-    return ix86_mangle_function_version_assembler_name (decl, id);
+    id = ix86_mangle_function_version_assembler_name (decl, id);
+#ifdef SUBTARGET_MANGLE_DECL_ASSEMBLER_NAME
+  id = SUBTARGET_MANGLE_DECL_ASSEMBLER_NAME (decl, id);
+#endif

   return id;
 }