--- gcc/config/i386/winnt.c.jj	2013-01-11 09:03:06.075488067 +0100
+++ gcc/config/i386/winnt.c	2013-02-04 11:40:31.314181511 +0100
@@ -250,8 +250,9 @@ i386_pe_assemble_visibility (tree decl,
   if (!decl
       || !lookup_attribute ("visibility", DECL_ATTRIBUTES (decl)))
     return;
-  warning (OPT_Wattributes, "visibility attribute not supported "
-	   "in this configuration; ignored");
+  if (!DECL_ARTIFICIAL (decl))
+    warning (OPT_Wattributes, "visibility attribute not supported "
+			      "in this configuration; ignored");
 }
 
 /* This is used as a target hook to modify the DECL_ASSEMBLER_NAME
--- gcc/config/sol2.c.jj	2013-01-11 09:03:07.000000000 +0100
+++ gcc/config/sol2.c	2013-02-04 11:40:51.417065051 +0100
@@ -124,8 +124,7 @@ solaris_output_init_fini (FILE *file, tr
    the visibility type VIS, which must not be VISIBILITY_DEFAULT.  */
 
 void
-solaris_assemble_visibility (tree decl ATTRIBUTE_UNUSED,
-			     int vis ATTRIBUTE_UNUSED)
+solaris_assemble_visibility (tree decl, int vis ATTRIBUTE_UNUSED)
 {
 #ifdef HAVE_GAS_HIDDEN
   /* Sun as uses .symbolic for STV_PROTECTED.  STV_INTERNAL is marked as
@@ -152,8 +151,9 @@ solaris_assemble_visibility (tree decl A
   assemble_name (asm_out_file, name);
   fprintf (asm_out_file, "\n");
 #else
-  warning (OPT_Wattributes, "visibility attribute not supported "
-	   "in this configuration; ignored");
+  if (!DECL_ARTIFICIAL (decl))
+    warning (OPT_Wattributes, "visibility attribute not supported "
+			      "in this configuration; ignored");
 #endif
 }
 
