This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR 9283 updated


PR 9283 Adds class/struct visibility and -fvisibility command line 
arg

(This patch supersedes Brian Ryner's of the same PR number).

Please find attached a patch against GCC CVS 20040324 adding the -
fvisibility command line arg, documentation for the same, 
class/struct visibility setting and improved symbol locality setting 
which gives better code quality.

I have tested this against the regression suite and the test results 
were identical to an unpatched version.

I have also compiled my library and Boost.Python based python 
bindings with excellent success. My BPL bindings were ~21Mb smaller 
and load in seconds rather than minutes. The exported symbol table 
dropped from >200,000 symbols to only ~19,000 with doing nothing 
other than using -fvisibility=hidden and __attribute__ 
((visibility("default"))) wherever __declspec(dllexport) was being 
used on MSVC. I am very happy with the results.

Cheers,
Niall




Only in gcc-3.4-20040324: config.back
Only in gcc-3.4-20040324: config.cache
Only in gcc-3.4-20040324: config.log
Only in gcc-3.4-20040324: config.status
Only in gcc-3.4-20040324/gcc: alias.o
Only in gcc-3.4-20040324/gcc: alloc-pool.o
Only in gcc-3.4-20040324/gcc: attribs.o
Only in gcc-3.4-20040324/gcc: auto-host.h
Only in gcc-3.4-20040324/gcc: bb-reorder.o
Only in gcc-3.4-20040324/gcc: bconfig.h
Only in gcc-3.4-20040324/gcc: bitmap.o
Only in gcc-3.4-20040324/gcc: bt-load.o
Only in gcc-3.4-20040324/gcc: builtins.o
Only in gcc-3.4-20040324/gcc: caller-save.o
Only in gcc-3.4-20040324/gcc: calls.o
Only in gcc-3.4-20040324/gcc: c-aux-info.o
Only in gcc-3.4-20040324/gcc: cc1
Only in gcc-3.4-20040324/gcc: cc1plus
diff -aur gcc-3.4-20040324orig/gcc/c-common.c gcc-3.4-20040324/gcc/c-common.c
--- gcc-3.4-20040324orig/gcc/c-common.c	2004-03-19 01:32:59.000000000 +0000
+++ gcc-3.4-20040324/gcc/c-common.c	2004-04-04 14:21:20.000000000 +0100
@@ -4873,6 +4873,25 @@
   return NULL_TREE;
 }
 
+bool
+parse_visibility (const char *str, enum symbol_visibility *vis)
+{
+  if (strcmp (str, "default") == 0)
+    *vis = VISIBILITY_DEFAULT;
+  else if (strcmp (str, "internal") == 0)
+    *vis = VISIBILITY_INTERNAL;
+  else if (strcmp (str, "hidden") == 0)
+    *vis = VISIBILITY_HIDDEN;  
+  else if (strcmp (str, "protected") == 0)
+    *vis = VISIBILITY_PROTECTED;
+  else {
+    error ("visibility arg must be one of \"default\", \"hidden\", \"protected\" or \"internal\"");
+    return false;
+  }
+
+  return true;
+}
+
 /* Handle an "visibility" attribute; arguments as in
    struct attribute_spec.handler.  */
 
@@ -4883,6 +4902,7 @@
 {
   tree decl = *node;
   tree id = TREE_VALUE (args);
+  enum symbol_visibility vis;
 
   *no_add_attrs = true;
 
@@ -4898,16 +4918,11 @@
       return NULL_TREE;
     }
 
-  if (strcmp (TREE_STRING_POINTER (id), "default") == 0)
-    DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT;
-  else if (strcmp (TREE_STRING_POINTER (id), "internal") == 0)
-    DECL_VISIBILITY (decl) = VISIBILITY_INTERNAL;
-  else if (strcmp (TREE_STRING_POINTER (id), "hidden") == 0)
-    DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;  
-  else if (strcmp (TREE_STRING_POINTER (id), "protected") == 0)
-    DECL_VISIBILITY (decl) = VISIBILITY_PROTECTED;
-  else
-    error ("visibility arg must be one of \"default\", \"hidden\", \"protected\" or \"internal\"");
+  if (parse_visibility (TREE_STRING_POINTER (id), &vis))
+    {
+      DECL_VISIBILITY (decl) = vis;
+      DECL_VISIBILITYSPECIFIED (decl) = 1;
+    }
 
   return NULL_TREE;
 }
Only in gcc-3.4-20040324/gcc: c-common.c.orig
diff -aur gcc-3.4-20040324orig/gcc/c-common.h gcc-3.4-20040324/gcc/c-common.h
--- gcc-3.4-20040324orig/gcc/c-common.h	2004-02-18 00:09:01.000000000 +0000
+++ gcc-3.4-20040324/gcc/c-common.h	2004-04-03 19:50:30.000000000 +0100
@@ -859,6 +859,10 @@
 extern const struct attribute_spec c_common_attribute_table[];
 extern const struct attribute_spec c_common_format_attribute_table[];
 
+/* Utility function to parse a visibility attribute string into one of the
+   symbol_visibility enum values.  */
+extern bool parse_visibility(const char *, enum symbol_visibility *);
+
 /* Pointer to function to lazily generate the VAR_DECL for __FUNCTION__ etc.
    ID is the identifier to use, NAME is the string.
    TYPE_DEP indicates whether it depends on type of the function or not
Only in gcc-3.4-20040324/gcc: c-common.o
Only in gcc-3.4-20040324/gcc: c-convert.o
Only in gcc-3.4-20040324/gcc: c-cppbuiltin.o
diff -aur gcc-3.4-20040324orig/gcc/c-decl.c gcc-3.4-20040324/gcc/c-decl.c
--- gcc-3.4-20040324orig/gcc/c-decl.c	2004-03-22 17:58:18.000000000 +0000
+++ gcc-3.4-20040324/gcc/c-decl.c	2004-04-05 12:13:33.000000000 +0100
@@ -1164,9 +1164,8 @@
     }
 
   /* warnings */
-  /* All decls must agree on a non-default visibility.  */
-  if (DECL_VISIBILITY (newdecl) != VISIBILITY_DEFAULT
-      && DECL_VISIBILITY (olddecl) != VISIBILITY_DEFAULT
+  /* All decls must agree on visibility.  */
+  if (DECL_VISIBILITYSPECIFIED (newdecl) && DECL_VISIBILITYSPECIFIED (olddecl)
       && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl))
     {
       warning ("%Jredeclaration of '%D' with different visibility "
@@ -1361,8 +1360,8 @@
      Currently, it can only be defined in the prototype.  */
   COPY_DECL_ASSEMBLER_NAME (olddecl, newdecl);
 
-  /* If either declaration has a nondefault visibility, use it.  */
-  if (DECL_VISIBILITY (olddecl) != VISIBILITY_DEFAULT)
+  /* Use visibility of whichever declaration had it specified */
+  if (DECL_VISIBILITYSPECIFIED (olddecl))
     DECL_VISIBILITY (newdecl) = DECL_VISIBILITY (olddecl);
 
   if (TREE_CODE (newdecl) == FUNCTION_DECL)
Only in gcc-3.4-20040324/gcc: c-decl.o
Only in gcc-3.4-20040324/gcc: c-dump.o
Only in gcc-3.4-20040324/gcc: c-errors.o
Only in gcc-3.4-20040324/gcc: cfganal.o
Only in gcc-3.4-20040324/gcc: cfgbuild.o
Only in gcc-3.4-20040324/gcc: cfgcleanup.o
Only in gcc-3.4-20040324/gcc: cfghooks.o
Only in gcc-3.4-20040324/gcc: cfglayout.o
Only in gcc-3.4-20040324/gcc: cfgloopanal.o
Only in gcc-3.4-20040324/gcc: cfgloopmanip.o
Only in gcc-3.4-20040324/gcc: cfgloop.o
Only in gcc-3.4-20040324/gcc: cfg.o
Only in gcc-3.4-20040324/gcc: cfgrtl.o
Only in gcc-3.4-20040324/gcc: c-format.o
Only in gcc-3.4-20040324/gcc: cgraph.o
Only in gcc-3.4-20040324/gcc: cgraphunit.o
Only in gcc-3.4-20040324/gcc: c-incpath.o
Only in gcc-3.4-20040324/gcc: c-lang.o
Only in gcc-3.4-20040324/gcc: c-lex.o
Only in gcc-3.4-20040324/gcc: c-objc-common.o
Only in gcc-3.4-20040324/gcc: collect2
Only in gcc-3.4-20040324/gcc: collect2.o
Only in gcc-3.4-20040324/gcc: combine.o
diff -aur gcc-3.4-20040324orig/gcc/common.opt gcc-3.4-20040324/gcc/common.opt
--- gcc-3.4-20040324orig/gcc/common.opt	2004-02-18 00:09:04.000000000 +0000
+++ gcc-3.4-20040324/gcc/common.opt	2004-04-04 00:13:57.000000000 +0100
@@ -718,6 +718,10 @@
 Common
 Add extra commentary to assembler output
 
+fvisibility=
+Common Joined RejectNegative
+-fvisibility=[default|internal|hidden|protected]	Set the default symbol visibility
+
 fvpt
 Common
 Use expression value profiles in optimizations
Only in gcc-3.4-20040324/gcc: configargs.h
Only in gcc-3.4-20040324/gcc: config.cache
Only in gcc-3.4-20040324/gcc: config.h
Only in gcc-3.4-20040324/gcc: config.log
Only in gcc-3.4-20040324/gcc: config.status
Only in gcc-3.4-20040324/gcc: conflict.o
Only in gcc-3.4-20040324/gcc: convert.o
diff -aur gcc-3.4-20040324orig/gcc/c-opts.c gcc-3.4-20040324/gcc/c-opts.c
--- gcc-3.4-20040324orig/gcc/c-opts.c	2004-02-18 00:09:03.000000000 +0000
+++ gcc-3.4-20040324/gcc/c-opts.c	2004-04-03 21:37:32.000000000 +0100
@@ -878,7 +878,7 @@
     case OPT_frtti:
       flag_rtti = value;
       break;
-
+      
     case OPT_fshow_column:
       cpp_opts->show_column = value;
       break;
Only in gcc-3.4-20040324/gcc: c-opts.o
Only in gcc-3.4-20040324/gcc: coverage.o
Only in gcc-3.4-20040324/gcc/cp: call.o
diff -aur gcc-3.4-20040324orig/gcc/cp/class.c gcc-3.4-20040324/gcc/cp/class.c
--- gcc-3.4-20040324orig/gcc/cp/class.c	2004-03-09 07:27:23.000000000 +0000
+++ gcc-3.4-20040324/gcc/cp/class.c	2004-04-04 18:05:34.000000000 +0100
@@ -59,6 +59,13 @@
 
   /* If were defining TYPE, the names used in this class.  */
   splay_tree names_used;
+
+  /* The class's visibility specification.  */
+  enum symbol_visibility visibility;
+  unsigned visibility_specified;
+
+  /* A list of member declarations which specify a non-default visibility. */
+  tree visibility_overrides;
 }* class_stack_node_t;
 
 typedef struct vtbl_init_data_s
@@ -102,6 +109,14 @@
 static int current_class_stack_size;
 static class_stack_node_t current_class_stack;
 
+/* Convenience macros for class visibility.  */
+#define CURRENT_VISIBILITY \
+  current_class_stack[current_class_depth - 1].visibility
+#define CURRENT_VISIBILITYSPECIFIED \
+  current_class_stack[current_class_depth - 1].visibility_specified
+#define CURRENT_VISIBILITY_OVERRIDES \
+  current_class_stack[current_class_depth - 1].visibility_overrides
+
 /* An array of all local classes present in this translation unit, in
    declaration order.  */
 varray_type local_classes;
@@ -524,6 +539,11 @@
   DECL_ALIGN (decl) = MAX (TYPE_ALIGN (double_type_node),
 			   DECL_ALIGN (decl));
 
+  /* The vtable's visibility is the class visibility.  There is no way
+     to override the visibility for just the vtable. */
+  DECL_VISIBILITY (decl) = CURRENT_VISIBILITY;
+  DECL_VISIBILITYSPECIFIED (decl) = CURRENT_VISIBILITYSPECIFIED;
+
   import_export_vtable (decl, class_type, 0);
 
   return decl;
@@ -2966,6 +2986,14 @@
 	  type = build_pointer_type (type);
 	  TREE_TYPE (x) = type;
 	}
+        
+      /* Apply the class's visibility attribute to static members
+        which do not have a visibility attribute unless they are inlined. */
+      if (! value_member (x, CURRENT_VISIBILITY_OVERRIDES) && !DECL_INLINE (x))
+        {
+          DECL_VISIBILITY (x) = CURRENT_VISIBILITY;
+          DECL_VISIBILITYSPECIFIED (x) = CURRENT_VISIBILITYSPECIFIED;
+        }
 
       if (type == error_mark_node)
 	continue;
@@ -3709,6 +3737,15 @@
       if (DECL_PURE_VIRTUAL_P (x) && ! DECL_VINDEX (x))
 	cp_error_at ("initializer specified for non-virtual method `%D'", x);
 
+      /* Apply the class's visibility attribute to methods which do
+         not have a visibility attribute except non-virtual inlined. */
+      if (! value_member (x, CURRENT_VISIBILITY_OVERRIDES)
+          && (!DECL_INLINE (x) || DECL_VIRTUAL_P (x)))
+        {
+          DECL_VISIBILITY (x) = CURRENT_VISIBILITY;
+          DECL_VISIBILITYSPECIFIED (x) = CURRENT_VISIBILITYSPECIFIED;
+        }
+
       /* The name of the field is the original field name
 	 Save this in auxiliary field for later overloading.  */
       if (DECL_VINDEX (x))
@@ -5151,6 +5188,44 @@
     }
 }
 
+/* Look for attributes that exist for both C and C++, but where special
+   handling is desired before the c-common attribute handler runs.  */
+static void
+prehandle_attributes (tree decl, tree *attributes)
+{
+  tree attr, prev = NULL_TREE;
+
+  for (attr = *attributes; attr; attr = TREE_CHAIN (attr))
+    {
+      if (is_attribute_p ("visibility", TREE_PURPOSE (attr)))
+      {
+         enum symbol_visibility vis;
+         tree value = TREE_VALUE (TREE_VALUE (attr));
+
+         if (TREE_CODE (value) != STRING_CST)
+           {
+             error ("visibility arg not a string");
+             return;
+           }
+
+         if (parse_visibility (TREE_STRING_POINTER (value), &vis))
+           {
+             /* This is now our current class visibility */
+             CURRENT_VISIBILITY = vis;
+             CURRENT_VISIBILITYSPECIFIED = 1;
+      
+             /* Remove the attribute so c-common doesn't complain about it. */
+             if (prev)
+               TREE_CHAIN (prev) = TREE_CHAIN (attr);
+             else
+               *attributes = TREE_CHAIN (attr);
+           }
+       }
+
+      prev = attr;
+    }
+}
+
 tree
 finish_struct (tree t, tree attributes)
 {
@@ -5160,6 +5235,10 @@
      as necessary.  */
   unreverse_member_declarations (t);
 
+  /* Handle class visibility here, so that the c-common attribute handler
+     doesn't see it.  */
+  prehandle_attributes (t, &attributes);
+
   cplus_decl_attributes (&t, attributes, (int) ATTR_FLAG_TYPE_IN_PLACE);
 
   /* Nadger the current location so that diagnostics point to the start of
@@ -5394,6 +5473,9 @@
   current_class_stack[current_class_depth].type = current_class_type;
   current_class_stack[current_class_depth].access = current_access_specifier;
   current_class_stack[current_class_depth].names_used = 0;
+  current_class_stack[current_class_depth].visibility = default_visibility;
+  current_class_stack[current_class_depth].visibility_specified = 0;
+  current_class_stack[current_class_depth].visibility_overrides = NULL_TREE;
   current_class_depth++;
 
   /* Now set up the new type.  */
@@ -7830,3 +7912,31 @@
   *vid->last_init = build_tree_list (NULL_TREE, init);
   vid->last_init = &TREE_CHAIN (*vid->last_init);
 }
+
+/* Add a decl to our list of decls that override the default visibility.
+   These decls will not have the class visibility applied to them.  */
+void
+add_visibility_override (tree decl)
+{
+  tree list_node;
+  class_stack_node_t current_class;
+
+  if (current_class_depth == 0)
+    return;
+
+  current_class = &current_class_stack[current_class_depth - 1];
+  list_node = build_tree_list(NULL, decl);
+  TREE_CHAIN(list_node) = current_class->visibility_overrides;
+  current_class->visibility_overrides = list_node;
+}
+
+enum symbol_visibility current_class_visibility (void)
+{
+  return CURRENT_VISIBILITY;
+}
+
+unsigned current_class_visibility_specified (void)
+{
+  return CURRENT_VISIBILITYSPECIFIED;
+}
+
Only in gcc-3.4-20040324/gcc/cp: class.c.orig
Only in gcc-3.4-20040324/gcc/cp: class.o
Only in gcc-3.4-20040324/gcc/cp: cp-lang.o
diff -aur gcc-3.4-20040324orig/gcc/cp/cp-tree.h gcc-3.4-20040324/gcc/cp/cp-tree.h
--- gcc-3.4-20040324orig/gcc/cp/cp-tree.h	2004-03-20 00:13:08.000000000 +0000
+++ gcc-3.4-20040324/gcc/cp/cp-tree.h	2004-04-04 15:30:24.000000000 +0100
@@ -3590,6 +3590,9 @@
 extern tree get_primary_binfo                   (tree);
 extern void debug_class				(tree);
 extern void debug_thunks 			(tree);
+extern void add_visibility_override             (tree);
+extern enum symbol_visibility current_class_visibility (void);
+extern unsigned current_class_visibility_specified (void);
 
 /* in cvt.c */
 extern tree convert_to_reference (tree, tree, int, int, tree);
Only in gcc-3.4-20040324/gcc/cp: cvt.o
Only in gcc-3.4-20040324/gcc/cp: cxx-pretty-print.o
diff -aur gcc-3.4-20040324orig/gcc/cp/decl2.c gcc-3.4-20040324/gcc/cp/decl2.c
--- gcc-3.4-20040324orig/gcc/cp/decl2.c	2004-03-20 00:13:13.000000000 +0000
+++ gcc-3.4-20040324/gcc/cp/decl2.c	2004-04-03 19:50:52.000000000 +0100
@@ -1113,6 +1113,11 @@
 
   if (TREE_CODE (*decl) == TYPE_DECL)
     SET_IDENTIFIER_TYPE_VALUE (DECL_NAME (*decl), TREE_TYPE (*decl));
+
+  /* If the member declaration specifies visibility, then make sure we
+     don't apply the class visibility to it.  */
+  if (lookup_attribute ("visibility", attributes))
+    add_visibility_override(*decl);
 }
 
 /* Defer the compilation of the FN until the end of compilation.  */
Only in gcc-3.4-20040324/gcc/cp: decl2.c.orig
Only in gcc-3.4-20040324/gcc/cp: decl2.o
diff -aur gcc-3.4-20040324orig/gcc/cp/decl.c gcc-3.4-20040324/gcc/cp/decl.c
--- gcc-3.4-20040324orig/gcc/cp/decl.c	2004-03-21 17:45:25.000000000 +0000
+++ gcc-3.4-20040324/gcc/cp/decl.c	2004-04-04 16:13:04.000000000 +0100
@@ -1869,18 +1869,16 @@
   DECL_COMMON (newdecl) = DECL_COMMON (olddecl);
   COPY_DECL_ASSEMBLER_NAME (olddecl, newdecl);
 
-  /* If either declaration has a nondefault visibility, use it.  */
-  if (DECL_VISIBILITY (olddecl) != VISIBILITY_DEFAULT)
-    {
-      if (DECL_VISIBILITY (newdecl) != VISIBILITY_DEFAULT
-	  && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl))
-	{
-	  warning ("%J'%D': visibility attribute ignored because it",
-		   newdecl, newdecl);
-	  warning ("%Jconflicts with previous declaration here", olddecl);
-	}
-      DECL_VISIBILITY (newdecl) = DECL_VISIBILITY (olddecl);
+  /* Warn about conflicting visibility specifications.  */
+  if (DECL_VISIBILITYSPECIFIED (olddecl) && DECL_VISIBILITYSPECIFIED (newdecl)
+      && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl))
+    {
+      warning ("%J'%D': visibility attribute ignored because it",
+        newdecl, newdecl);
+      warning ("%Jconflicts with previous declaration here", olddecl);
     }
+  DECL_VISIBILITY (newdecl) = DECL_VISIBILITY (olddecl);
+  DECL_VISIBILITYSPECIFIED (newdecl) = DECL_VISIBILITYSPECIFIED (olddecl);
 
   if (TREE_CODE (newdecl) == FUNCTION_DECL)
     {
Only in gcc-3.4-20040324/gcc/cp: decl.o
Only in gcc-3.4-20040324/gcc/cp: dump.o
Only in gcc-3.4-20040324/gcc/cp: error.o
Only in gcc-3.4-20040324/gcc/cp: except.o
Only in gcc-3.4-20040324/gcc/cp: expr.o
Only in gcc-3.4-20040324/gcc/cp: friend.o
Only in gcc-3.4-20040324/gcc/cp: include
Only in gcc-3.4-20040324/gcc/cp: init.o
Only in gcc-3.4-20040324/gcc/cp: lex.o
Only in gcc-3.4-20040324/gcc/cp: mangle.o
diff -aur gcc-3.4-20040324orig/gcc/cp/method.c gcc-3.4-20040324/gcc/cp/method.c
--- gcc-3.4-20040324orig/gcc/cp/method.c	2004-02-05 16:06:52.000000000 +0000
+++ gcc-3.4-20040324/gcc/cp/method.c	2004-04-04 14:54:23.000000000 +0100
@@ -390,6 +390,7 @@
      rewrite.  */
   TREE_PUBLIC (thunk_fndecl) = TREE_PUBLIC (function);
   DECL_VISIBILITY (thunk_fndecl) = DECL_VISIBILITY (function);
+  DECL_VISIBILITYSPECIFIED (thunk_fndecl) = DECL_VISIBILITYSPECIFIED (function);
 
   if (flag_syntax_only)
     {
Only in gcc-3.4-20040324/gcc/cp: method.o
Only in gcc-3.4-20040324/gcc/cp: name-lookup.o
diff -aur gcc-3.4-20040324orig/gcc/cp/optimize.c gcc-3.4-20040324/gcc/cp/optimize.c
--- gcc-3.4-20040324orig/gcc/cp/optimize.c	2004-02-08 01:52:50.000000000 +0000
+++ gcc-3.4-20040324/gcc/cp/optimize.c	2004-04-04 16:11:24.000000000 +0100
@@ -155,6 +155,7 @@
       DECL_NOT_REALLY_EXTERN (clone) = DECL_NOT_REALLY_EXTERN (fn);
       TREE_PUBLIC (clone) = TREE_PUBLIC (fn);
       DECL_VISIBILITY (clone) = DECL_VISIBILITY (fn);
+      DECL_VISIBILITYSPECIFIED (clone) = DECL_VISIBILITYSPECIFIED (fn);
 
       /* Adjust the parameter names and locations.  */
       parm = DECL_ARGUMENTS (fn);
Only in gcc-3.4-20040324/gcc/cp: optimize.o
Only in gcc-3.4-20040324/gcc/cp: parser.o
Only in gcc-3.4-20040324/gcc/cp: pt.o
Only in gcc-3.4-20040324/gcc/cp: ptree.o
Only in gcc-3.4-20040324/gcc/cp: repo.o
diff -aur gcc-3.4-20040324orig/gcc/cp/rtti.c gcc-3.4-20040324/gcc/cp/rtti.c
--- gcc-3.4-20040324orig/gcc/cp/rtti.c	2004-03-08 23:00:26.000000000 +0000
+++ gcc-3.4-20040324/gcc/cp/rtti.c	2004-04-04 15:32:07.000000000 +0100
@@ -361,8 +361,12 @@
       pushdecl_top_level_and_finish (d, NULL_TREE);
 
       if (CLASS_TYPE_P (type))
-	CLASSTYPE_TYPEINFO_VAR (TYPE_MAIN_VARIANT (type)) = d;
-
+        {
+          CLASSTYPE_TYPEINFO_VAR (TYPE_MAIN_VARIANT (type)) = d;
+          DECL_VISIBILITY (d) = current_class_visibility();
+          DECL_VISIBILITYSPECIFIED (d) = current_class_visibility_specified();
+        }
+      
       /* Remember the type it is for.  */
       TREE_TYPE (name) = type;
 
@@ -759,6 +763,8 @@
     TREE_STATIC (name_decl) = 1;
     DECL_EXTERNAL (name_decl) = 0;
     TREE_PUBLIC (name_decl) = 1;
+    DECL_VISIBILITY (name_decl) = current_class_visibility();
+    DECL_VISIBILITYSPECIFIED (name_decl) = current_class_visibility_specified();
     import_export_tinfo (name_decl, target, typeinfo_in_lib_p (target));
     /* External name of the string containing the type's name has a
        special name.  */
Only in gcc-3.4-20040324/gcc/cp: rtti.o
Only in gcc-3.4-20040324/gcc/cp: search.o
Only in gcc-3.4-20040324/gcc/cp: semantics.o
Only in gcc-3.4-20040324/gcc/cp: stage1
Only in gcc-3.4-20040324/gcc/cp: stage2
Only in gcc-3.4-20040324/gcc/cp: stage3
Only in gcc-3.4-20040324/gcc/cp: stage4
Only in gcc-3.4-20040324/gcc/cp: stagefeedback
Only in gcc-3.4-20040324/gcc/cp: stageprofile
Only in gcc-3.4-20040324/gcc/cp: tree.o
Only in gcc-3.4-20040324/gcc/cp: typeck2.o
Only in gcc-3.4-20040324/gcc/cp: typeck.o
Only in gcc-3.4-20040324/gcc: c-parse.c
Only in gcc-3.4-20040324/gcc: c-parse.o
Only in gcc-3.4-20040324/gcc: c-parse.y
Only in gcc-3.4-20040324/gcc: c-pch.o
Only in gcc-3.4-20040324/gcc: cpp
Only in gcc-3.4-20040324/gcc: cppcharset.o
Only in gcc-3.4-20040324/gcc: cppdefault.o
Only in gcc-3.4-20040324/gcc: cpperror.o
Only in gcc-3.4-20040324/gcc: cppexp.o
Only in gcc-3.4-20040324/gcc: cppfiles.o
Only in gcc-3.4-20040324/gcc: cpphash.o
Only in gcc-3.4-20040324/gcc: cppinit.o
Only in gcc-3.4-20040324/gcc: cpplex.o
Only in gcc-3.4-20040324/gcc: cpplib.o
Only in gcc-3.4-20040324/gcc: cppmacro.o
Only in gcc-3.4-20040324/gcc: c-ppoutput.o
Only in gcc-3.4-20040324/gcc: cpppch.o
Only in gcc-3.4-20040324/gcc: cppspec.o
Only in gcc-3.4-20040324/gcc: cpptrad.o
Only in gcc-3.4-20040324/gcc: c-pragma.o
Only in gcc-3.4-20040324/gcc: c-pretty-print.o
Only in gcc-3.4-20040324/gcc: crtbegin.o
Only in gcc-3.4-20040324/gcc: crtbeginS.o
Only in gcc-3.4-20040324/gcc: crtbeginT.o
Only in gcc-3.4-20040324/gcc: crtend.o
Only in gcc-3.4-20040324/gcc: crtendS.o
Only in gcc-3.4-20040324/gcc: cs-bconfig.h
Only in gcc-3.4-20040324/gcc: cs-config.h
Only in gcc-3.4-20040324/gcc: cselib.o
Only in gcc-3.4-20040324/gcc: c-semantics.o
Only in gcc-3.4-20040324/gcc: cse.o
Only in gcc-3.4-20040324/gcc: cstamp-h
Only in gcc-3.4-20040324/gcc: cs-tconfig.h
Only in gcc-3.4-20040324/gcc: cs-tm.h
Only in gcc-3.4-20040324/gcc: cs-tm_p.h
Only in gcc-3.4-20040324/gcc: c-typeck.o
Only in gcc-3.4-20040324/gcc: dbxout.o
Only in gcc-3.4-20040324/gcc: debug.o
Only in gcc-3.4-20040324/gcc: df.o
Only in gcc-3.4-20040324/gcc: diagnostic.o
Only in gcc-3.4-20040324/gcc/doc: cpp.1
Only in gcc-3.4-20040324/gcc/doc: cpp.info
Only in gcc-3.4-20040324/gcc/doc: cppinternals.info
Only in gcc-3.4-20040324/gcc/doc: fsf-funding.7
Only in gcc-3.4-20040324/gcc/doc: g++.1
Only in gcc-3.4-20040324/gcc/doc: gcc.1
Only in gcc-3.4-20040324/gcc/doc: gcc.info
Only in gcc-3.4-20040324/gcc/doc: gccinstall.info
Only in gcc-3.4-20040324/gcc/doc: gccint.info
Only in gcc-3.4-20040324/gcc/doc: gcov.1
Only in gcc-3.4-20040324/gcc/doc: gfdl.7
Only in gcc-3.4-20040324/gcc/doc: gpl.7
diff -aur gcc-3.4-20040324orig/gcc/doc/invoke.texi gcc-3.4-20040324/gcc/doc/invoke.texi
--- gcc-3.4-20040324orig/gcc/doc/invoke.texi	2004-03-15 21:15:33.000000000 +0000
+++ gcc-3.4-20040324/gcc/doc/invoke.texi	2004-04-05 13:01:28.000000000 +0100
@@ -1,4 +1,4 @@
-@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+ @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 @c 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 @c This is part of the GCC manual.
 @c For copying conditions, see the file gcc.texi.
@@ -674,7 +674,9 @@
 -fargument-alias  -fargument-noalias @gol
 -fargument-noalias-global  -fleading-underscore @gol
 -ftls-model=@var{model} @gol
--ftrapv  -fwrapv  -fbounds-check}
+-ftrapv  -fwrapv  -fbounds-check
+-fvisibility
+}
 @end table
 
 @menu
@@ -11195,6 +11197,34 @@
 
 The default without @option{-fpic} is @code{initial-exec}; with
 @option{-fpic} the default is @code{global-dynamic}.
+
+@item -fvisibility=@var{[default|internal|hidden|protected]}
+Set the default ELF image symbol visibility to the specified option - all
+symbols will be marked with this unless overrided within the code.
+Using this feature can very substantially improve linking and
+load times of shared object libraries, produce more optimised
+code, provide near-perfect API export and prevent symbol clashes.
+It is @strong{strongly} recommended that you use this in any shared objects
+you distribute.
+     
+Despite the nomenclature, @code{default} always means public ie;
+available to be linked against from outside the shared object.
+@code{protected} and @code{internal} are pretty useless in real-world
+usage so the only other commonly used option will be @code{hidden}.
+The default if not specified is @code{default} ie; make every
+symbol public.
+     
+A good explanation of the benefits offered by ensuring ELF
+symbols have the correct visibility is given by ``How To Write
+Shared Libraries'' by Ulrich Drepper - however a superior
+solution made possible by this option to marking things hidden when
+the default is public is to make the default hidden and mark things
+public. This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
+and @code{__attribute__ ((visibility("default")))} instead of
+@code{__declspec(dllexport)} you get almost identical semantics with
+identical syntax. This is a great boon to those working with
+cross-platform projects.
+
 @end table
 
 @c man end
Only in gcc-3.4-20040324/gcc: dojump.o
Only in gcc-3.4-20040324/gcc: doloop.o
Only in gcc-3.4-20040324/gcc: dominance.o
Only in gcc-3.4-20040324/gcc: dummy-conditions.o
Only in gcc-3.4-20040324/gcc: dwarf2asm.o
Only in gcc-3.4-20040324/gcc: dwarf2out.o
Only in gcc-3.4-20040324/gcc: emit-rtl.o
Only in gcc-3.4-20040324/gcc: errors.o
Only in gcc-3.4-20040324/gcc: et-forest.o
Only in gcc-3.4-20040324/gcc: except.o
Only in gcc-3.4-20040324/gcc: explow.o
Only in gcc-3.4-20040324/gcc: expmed.o
Only in gcc-3.4-20040324/gcc: expr.o
Only in gcc-3.4-20040324/gcc: final.o
Only in gcc-3.4-20040324/gcc/fixinc: fixfixes.o
Only in gcc-3.4-20040324/gcc/fixinc: fixincl
Only in gcc-3.4-20040324/gcc/fixinc: fixincl.o
Only in gcc-3.4-20040324/gcc/fixinc: fixlib.o
Only in gcc-3.4-20040324/gcc/fixinc: fixtests.o
Only in gcc-3.4-20040324/gcc/fixinc: full-stamp
Only in gcc-3.4-20040324/gcc/fixinc: include
Only in gcc-3.4-20040324/gcc/fixinc: machname.h
Only in gcc-3.4-20040324/gcc/fixinc: Makefile
Only in gcc-3.4-20040324/gcc/fixinc: procopen.o
Only in gcc-3.4-20040324/gcc/fixinc: server.o
Only in gcc-3.4-20040324/gcc/fixinc: stage1
Only in gcc-3.4-20040324/gcc/fixinc: stage2
Only in gcc-3.4-20040324/gcc/fixinc: stage3
Only in gcc-3.4-20040324/gcc/fixinc: stage4
Only in gcc-3.4-20040324/gcc/fixinc: stagefeedback
Only in gcc-3.4-20040324/gcc/fixinc: stageprofile
Only in gcc-3.4-20040324/gcc: fixinc.sh
diff -aur gcc-3.4-20040324orig/gcc/flags.h gcc-3.4-20040324/gcc/flags.h
--- gcc-3.4-20040324orig/gcc/flags.h	2004-02-18 00:09:04.000000000 +0000
+++ gcc-3.4-20040324/gcc/flags.h	2004-04-03 22:11:52.000000000 +0100
@@ -60,6 +60,20 @@
 /* Nonzero means emit debugging information only for symbols which are used.  */
 extern int flag_debug_only_used_symbols;
 
+#ifndef SYMBOL_VISIBILITY_DEFINED
+#define SYMBOL_VISIBILITY_DEFINED
+enum symbol_visibility
+{
+  VISIBILITY_DEFAULT,
+  VISIBILITY_INTERNAL,
+  VISIBILITY_HIDDEN,
+  VISIBILITY_PROTECTED
+};
+#endif
+
+/* The default visibility for all symbols (unless overridden) */
+extern enum symbol_visibility default_visibility;
+
 /* Nonzero means do optimizations.  -opt.  */
 
 extern int optimize;
Only in gcc-3.4-20040324/gcc: flow.o
Only in gcc-3.4-20040324/gcc: fold-const.o
Only in gcc-3.4-20040324/gcc: function.o
Only in gcc-3.4-20040324/gcc: g++
Only in gcc-3.4-20040324/gcc: gccbug
Only in gcc-3.4-20040324/gcc: gcc.o
Only in gcc-3.4-20040324/gcc: gccspec.o
Only in gcc-3.4-20040324/gcc: gcov
Only in gcc-3.4-20040324/gcc: gcov-dump
Only in gcc-3.4-20040324/gcc: gcov-dump.o
Only in gcc-3.4-20040324/gcc: gcov-iov
Only in gcc-3.4-20040324/gcc: gcov-iov.h
Only in gcc-3.4-20040324/gcc: gcov-iov.o
Only in gcc-3.4-20040324/gcc: gcov.o
Only in gcc-3.4-20040324/gcc: gcse.o
Only in gcc-3.4-20040324/gcc: .gdbinit
Only in gcc-3.4-20040324/gcc: genattr
Only in gcc-3.4-20040324/gcc: genattr.o
Only in gcc-3.4-20040324/gcc: genattrtab
Only in gcc-3.4-20040324/gcc: genattrtab.o
Only in gcc-3.4-20040324/gcc: genautomata.o
Only in gcc-3.4-20040324/gcc: gencheck
Only in gcc-3.4-20040324/gcc: gencheck.h
Only in gcc-3.4-20040324/gcc: gencheck.o
Only in gcc-3.4-20040324/gcc: gencodes
Only in gcc-3.4-20040324/gcc: gencodes.o
Only in gcc-3.4-20040324/gcc: genconditions
Only in gcc-3.4-20040324/gcc: genconditions.o
Only in gcc-3.4-20040324/gcc: genconfig
Only in gcc-3.4-20040324/gcc: genconfig.o
Only in gcc-3.4-20040324/gcc: genconstants
Only in gcc-3.4-20040324/gcc: genconstants.o
Only in gcc-3.4-20040324/gcc: genemit
Only in gcc-3.4-20040324/gcc: genemit.o
Only in gcc-3.4-20040324/gcc: genextract
Only in gcc-3.4-20040324/gcc: genextract.o
Only in gcc-3.4-20040324/gcc: genflags
Only in gcc-3.4-20040324/gcc: genflags.o
Only in gcc-3.4-20040324/gcc: gengenrtl
Only in gcc-3.4-20040324/gcc: gengenrtl.o
Only in gcc-3.4-20040324/gcc: gengtype
Only in gcc-3.4-20040324/gcc: gengtype-lex.c
Only in gcc-3.4-20040324/gcc: gengtype-lex.o
Only in gcc-3.4-20040324/gcc: gengtype.o
Only in gcc-3.4-20040324/gcc: gengtype-yacc.c
Only in gcc-3.4-20040324/gcc: gengtype-yacc.h
Only in gcc-3.4-20040324/gcc: gengtype-yacc.o
Only in gcc-3.4-20040324/gcc: genmodes
Only in gcc-3.4-20040324/gcc: genmodes.o
Only in gcc-3.4-20040324/gcc: genopinit
Only in gcc-3.4-20040324/gcc: genopinit.o
Only in gcc-3.4-20040324/gcc: genoutput
Only in gcc-3.4-20040324/gcc: genoutput.o
Only in gcc-3.4-20040324/gcc: genpeep
Only in gcc-3.4-20040324/gcc: genpeep.o
Only in gcc-3.4-20040324/gcc: genpreds
Only in gcc-3.4-20040324/gcc: genpreds.o
Only in gcc-3.4-20040324/gcc: genrecog
Only in gcc-3.4-20040324/gcc: genrecog.o
Only in gcc-3.4-20040324/gcc: genrtl.c
Only in gcc-3.4-20040324/gcc: genrtl.h
Only in gcc-3.4-20040324/gcc: genrtl.o
Only in gcc-3.4-20040324/gcc: gensupport.o
Only in gcc-3.4-20040324/gcc: ggc-common.o
Only in gcc-3.4-20040324/gcc: ggc-none.o
Only in gcc-3.4-20040324/gcc: ggc-page.o
Only in gcc-3.4-20040324/gcc: global.o
Only in gcc-3.4-20040324/gcc: graph.o
Only in gcc-3.4-20040324/gcc: g++spec.o
Only in gcc-3.4-20040324/gcc: gt-alias.h
Only in gcc-3.4-20040324/gcc: gt-bitmap.h
Only in gcc-3.4-20040324/gcc: gt-c-common.h
Only in gcc-3.4-20040324/gcc: gt-c-decl.h
Only in gcc-3.4-20040324/gcc: gt-cfglayout.h
Only in gcc-3.4-20040324/gcc: gt-cgraph.h
Only in gcc-3.4-20040324/gcc: gt-coverage.h
Only in gcc-3.4-20040324/gcc: gt-c-parse.h
Only in gcc-3.4-20040324/gcc: gt-cp-call.h
Only in gcc-3.4-20040324/gcc: gt-cp-decl2.h
Only in gcc-3.4-20040324/gcc: gt-cp-decl.h
Only in gcc-3.4-20040324/gcc: gt-cp-mangle.h
Only in gcc-3.4-20040324/gcc: gt-cp-method.h
Only in gcc-3.4-20040324/gcc: gt-cp-name-lookup.h
Only in gcc-3.4-20040324/gcc: gt-cp-parser.h
Only in gcc-3.4-20040324/gcc: gt-cp-pt.h
Only in gcc-3.4-20040324/gcc: gt-c-pragma.h
Only in gcc-3.4-20040324/gcc: gt-cp-repo.h
Only in gcc-3.4-20040324/gcc: gt-cp-semantics.h
Only in gcc-3.4-20040324/gcc: gt-cp-tree.h
Only in gcc-3.4-20040324/gcc: gt-cselib.h
Only in gcc-3.4-20040324/gcc: gt-dbxout.h
Only in gcc-3.4-20040324/gcc: gt-dwarf2asm.h
Only in gcc-3.4-20040324/gcc: gt-dwarf2out.h
Only in gcc-3.4-20040324/gcc: gt-emit-rtl.h
Only in gcc-3.4-20040324/gcc: gt-except.h
Only in gcc-3.4-20040324/gcc: gt-explow.h
Only in gcc-3.4-20040324/gcc: gt-expr.h
Only in gcc-3.4-20040324/gcc: gt-fold-const.h
Only in gcc-3.4-20040324/gcc: gt-function.h
Only in gcc-3.4-20040324/gcc: gt-gcse.h
Only in gcc-3.4-20040324/gcc: gthr-default.h
Only in gcc-3.4-20040324/gcc: gt-i386.h
Only in gcc-3.4-20040324/gcc: gt-integrate.h
Only in gcc-3.4-20040324/gcc: gt-langhooks.h
Only in gcc-3.4-20040324/gcc: gt-lists.h
Only in gcc-3.4-20040324/gcc: gt-optabs.h
Only in gcc-3.4-20040324/gcc: gt-ra-build.h
Only in gcc-3.4-20040324/gcc: gt-regclass.h
Only in gcc-3.4-20040324/gcc: gt-reg-stack.h
Only in gcc-3.4-20040324/gcc: gt-sdbout.h
Only in gcc-3.4-20040324/gcc: gt-stmt.h
Only in gcc-3.4-20040324/gcc: gt-stor-layout.h
Only in gcc-3.4-20040324/gcc: gt-stringpool.h
Only in gcc-3.4-20040324/gcc: gt-tree.h
Only in gcc-3.4-20040324/gcc: gt-varasm.h
Only in gcc-3.4-20040324/gcc: gtype-c.h
Only in gcc-3.4-20040324/gcc: gtype-cp.h
Only in gcc-3.4-20040324/gcc: gtype-desc.c
Only in gcc-3.4-20040324/gcc: gtype-desc.h
Only in gcc-3.4-20040324/gcc: gtype-desc.o
Only in gcc-3.4-20040324/gcc: gtyp-gen.h
Only in gcc-3.4-20040324/gcc: haifa-sched.o
Only in gcc-3.4-20040324/gcc: hashtable.o
Only in gcc-3.4-20040324/gcc: hooks.o
Only in gcc-3.4-20040324/gcc: host-default.o
Only in gcc-3.4-20040324/gcc: i386.o
Only in gcc-3.4-20040324/gcc: ifcvt.o
Only in gcc-3.4-20040324/gcc: include
Only in gcc-3.4-20040324/gcc: insn-attr.h
Only in gcc-3.4-20040324/gcc: insn-attrtab.c
Only in gcc-3.4-20040324/gcc: insn-attrtab.o
Only in gcc-3.4-20040324/gcc: insn-codes.h
Only in gcc-3.4-20040324/gcc: insn-conditions.c
Only in gcc-3.4-20040324/gcc: insn-conditions.o
Only in gcc-3.4-20040324/gcc: insn-config.h
Only in gcc-3.4-20040324/gcc: insn-constants.h
Only in gcc-3.4-20040324/gcc: insn-emit.c
Only in gcc-3.4-20040324/gcc: insn-emit.o
Only in gcc-3.4-20040324/gcc: insn-extract.c
Only in gcc-3.4-20040324/gcc: insn-extract.o
Only in gcc-3.4-20040324/gcc: insn-flags.h
Only in gcc-3.4-20040324/gcc: insn-modes.c
Only in gcc-3.4-20040324/gcc: insn-modes.h
Only in gcc-3.4-20040324/gcc: insn-modes.o
Only in gcc-3.4-20040324/gcc: insn-opinit.c
Only in gcc-3.4-20040324/gcc: insn-opinit.o
Only in gcc-3.4-20040324/gcc: insn-output.c
Only in gcc-3.4-20040324/gcc: insn-output.o
Only in gcc-3.4-20040324/gcc: insn-peep.c
Only in gcc-3.4-20040324/gcc: insn-peep.o
Only in gcc-3.4-20040324/gcc: insn-recog.c
Only in gcc-3.4-20040324/gcc: insn-recog.o
Only in gcc-3.4-20040324/gcc: integrate.o
Only in gcc-3.4-20040324/gcc: intl.o
Only in gcc-3.4-20040324/gcc: jump.o
Only in gcc-3.4-20040324/gcc: langhooks.o
Only in gcc-3.4-20040324/gcc: lcm.o
Only in gcc-3.4-20040324/gcc: libbackend.a
Only in gcc-3.4-20040324/gcc: libcpp.a
Only in gcc-3.4-20040324/gcc: libgcc
Only in gcc-3.4-20040324/gcc: libgcc.a
Only in gcc-3.4-20040324/gcc: libgcc_eh.a
Only in gcc-3.4-20040324/gcc: libgcc.mk
Only in gcc-3.4-20040324/gcc: libgcc_s.so
Only in gcc-3.4-20040324/gcc: libgcc_s.so.1
Only in gcc-3.4-20040324/gcc: libgcov.a
Only in gcc-3.4-20040324/gcc: line-map.o
Only in gcc-3.4-20040324/gcc: lists.o
Only in gcc-3.4-20040324/gcc: local-alloc.o
Only in gcc-3.4-20040324/gcc: loop-init.o
Only in gcc-3.4-20040324/gcc: loop.o
Only in gcc-3.4-20040324/gcc: loop-unroll.o
Only in gcc-3.4-20040324/gcc: loop-unswitch.o
Only in gcc-3.4-20040324/gcc: main.o
Only in gcc-3.4-20040324/gcc: Makefile
Only in gcc-3.4-20040324/gcc: Make-hooks
Only in gcc-3.4-20040324/gcc: min-insn-modes.c
Only in gcc-3.4-20040324/gcc: min-insn-modes.o
Only in gcc-3.4-20040324/gcc: mkdeps.o
Only in gcc-3.4-20040324/gcc: mkheaders
Only in gcc-3.4-20040324/gcc: mklibgcc
Only in gcc-3.4-20040324/gcc: multilib.h
Only in gcc-3.4-20040324/gcc: optabs.o
Only in gcc-3.4-20040324/gcc: options.c
Only in gcc-3.4-20040324/gcc: options.h
Only in gcc-3.4-20040324/gcc: options.o
diff -aur gcc-3.4-20040324orig/gcc/opts.c gcc-3.4-20040324/gcc/opts.c
--- gcc-3.4-20040324orig/gcc/opts.c	2004-02-18 00:09:04.000000000 +0000
+++ gcc-3.4-20040324/gcc/opts.c	2004-04-04 00:15:54.000000000 +0100
@@ -142,6 +142,9 @@
    write_symbols is set to DBX_DEBUG, XCOFF_DEBUG, or DWARF_DEBUG.  */
 bool use_gnu_debug_info_extensions;
 
+/* The default visibility for all symbols (unless overridden) */
+enum symbol_visibility default_visibility = VISIBILITY_DEFAULT;
+
 /* Columns of --help display.  */
 static unsigned int columns = 80;
 
@@ -1440,6 +1443,21 @@
       flag_verbose_asm = value;
       break;
 
+    case OPT_fvisibility_:
+      {
+        if(!strcmp(arg, "default"))
+          default_visibility=VISIBILITY_DEFAULT;
+        else if(!strcmp(arg, "internal"))
+          default_visibility=VISIBILITY_INTERNAL;
+        else if(!strcmp(arg, "hidden"))
+          default_visibility=VISIBILITY_HIDDEN;
+        else if(!strcmp(arg, "protected"))
+          default_visibility=VISIBILITY_PROTECTED;
+        else
+          error("unrecognised visibility value \"%s\"", arg);
+      }
+      break;
+
     case OPT_fweb:
       flag_web = value;
       break;
Only in gcc-3.4-20040324/gcc: opts.o
Only in gcc-3.4-20040324/gcc: params.o
Only in gcc-3.4-20040324/gcc/po: be.gmo
Only in gcc-3.4-20040324/gcc/po: ca.gmo
Only in gcc-3.4-20040324/gcc/po: da.gmo
Only in gcc-3.4-20040324/gcc/po: de.gmo
Only in gcc-3.4-20040324/gcc/po: el.gmo
Only in gcc-3.4-20040324/gcc/po: es.gmo
Only in gcc-3.4-20040324/gcc/po: fr.gmo
Only in gcc-3.4-20040324/gcc/po: ja.gmo
Only in gcc-3.4-20040324/gcc/po: nl.gmo
Only in gcc-3.4-20040324/gcc/po: sv.gmo
Only in gcc-3.4-20040324/gcc/po: tr.gmo
Only in gcc-3.4-20040324/gcc: postreload.o
Only in gcc-3.4-20040324/gcc: predict.o
Only in gcc-3.4-20040324/gcc: prefix.o
Only in gcc-3.4-20040324/gcc: pretty-print.o
Only in gcc-3.4-20040324/gcc: print-rtl1.c
Only in gcc-3.4-20040324/gcc: print-rtl1.o
Only in gcc-3.4-20040324/gcc: print-rtl.o
Only in gcc-3.4-20040324/gcc: print-tree.o
Only in gcc-3.4-20040324/gcc: profile.o
Only in gcc-3.4-20040324/gcc: ra-build.o
Only in gcc-3.4-20040324/gcc: ra-colorize.o
Only in gcc-3.4-20040324/gcc: ra-debug.o
Only in gcc-3.4-20040324/gcc: ra.o
Only in gcc-3.4-20040324/gcc: ra-rewrite.o
Only in gcc-3.4-20040324/gcc: read-rtl.o
Only in gcc-3.4-20040324/gcc: real.o
Only in gcc-3.4-20040324/gcc: recog.o
Only in gcc-3.4-20040324/gcc: regclass.o
Only in gcc-3.4-20040324/gcc: regmove.o
Only in gcc-3.4-20040324/gcc: regrename.o
Only in gcc-3.4-20040324/gcc: reg-stack.o
Only in gcc-3.4-20040324/gcc: reload1.o
Only in gcc-3.4-20040324/gcc: reload.o
Only in gcc-3.4-20040324/gcc: reorg.o
Only in gcc-3.4-20040324/gcc: resource.o
Only in gcc-3.4-20040324/gcc: rtlanal.o
Only in gcc-3.4-20040324/gcc: rtl-error.o
Only in gcc-3.4-20040324/gcc: rtl.o
Only in gcc-3.4-20040324/gcc: s-attr
Only in gcc-3.4-20040324/gcc: s-attrtab
Only in gcc-3.4-20040324/gcc: sbitmap.o
Only in gcc-3.4-20040324/gcc: s-check
Only in gcc-3.4-20040324/gcc: sched-deps.o
Only in gcc-3.4-20040324/gcc: sched-ebb.o
Only in gcc-3.4-20040324/gcc: sched-rgn.o
Only in gcc-3.4-20040324/gcc: sched-vis.o
Only in gcc-3.4-20040324/gcc: s-codes
Only in gcc-3.4-20040324/gcc: s-conditions
Only in gcc-3.4-20040324/gcc: s-config
Only in gcc-3.4-20040324/gcc: s-constants
Only in gcc-3.4-20040324/gcc: sdbout.o
Only in gcc-3.4-20040324/gcc: s-emit
Only in gcc-3.4-20040324/gcc: s-extract
Only in gcc-3.4-20040324/gcc: s-flags
Only in gcc-3.4-20040324/gcc: s-gencheck
Only in gcc-3.4-20040324/gcc: s-genrtl
Only in gcc-3.4-20040324/gcc: s-gtype
Only in gcc-3.4-20040324/gcc: sibcall.o
Only in gcc-3.4-20040324/gcc: simplify-rtx.o
Only in gcc-3.4-20040324/gcc: s-iov
Only in gcc-3.4-20040324/gcc: site.bak
Only in gcc-3.4-20040324/gcc: site.exp
Only in gcc-3.4-20040324/gcc: s-mlib
Only in gcc-3.4-20040324/gcc: s-modes
Only in gcc-3.4-20040324/gcc: s-opinit
Only in gcc-3.4-20040324/gcc: s-output
Only in gcc-3.4-20040324/gcc: specs
Only in gcc-3.4-20040324/gcc: specs.h
Only in gcc-3.4-20040324/gcc: specs.ready
Only in gcc-3.4-20040324/gcc: s-peep
Only in gcc-3.4-20040324/gcc: s-preds
Only in gcc-3.4-20040324/gcc: sreal.o
Only in gcc-3.4-20040324/gcc: s-recog
Only in gcc-3.4-20040324/gcc: s-specs
Only in gcc-3.4-20040324/gcc: stage1
Only in gcc-3.4-20040324/gcc: stage1_build
Only in gcc-3.4-20040324/gcc: stage1_copy
Only in gcc-3.4-20040324/gcc: stage2
Only in gcc-3.4-20040324/gcc: stage2_build
Only in gcc-3.4-20040324/gcc: stage2_copy
Only in gcc-3.4-20040324/gcc: stage3_build
Only in gcc-3.4-20040324/gcc: stage_last
Only in gcc-3.4-20040324/gcc: stmp-dirs
Only in gcc-3.4-20040324/gcc: stmp-fixinc
Only in gcc-3.4-20040324/gcc: stmp-int-hdrs
Only in gcc-3.4-20040324/gcc: stmt.o
Only in gcc-3.4-20040324/gcc: stor-layout.o
Only in gcc-3.4-20040324/gcc: stringpool.o
Only in gcc-3.4-20040324/gcc: stub-objc.o
Only in gcc-3.4-20040324/gcc: targhooks.o
Only in gcc-3.4-20040324/gcc: tconfig.h
Only in gcc-3.4-20040324/gcc: testsuite
Only in gcc-3.4-20040324/gcc: testVis
Only in gcc-3.4-20040324/gcc: testVis.c
Only in gcc-3.4-20040324/gcc: testVis.cpp
Only in gcc-3.4-20040324/gcc: timevar.o
Only in gcc-3.4-20040324/gcc: tlink.o
Only in gcc-3.4-20040324/gcc: tm.h
Only in gcc-3.4-20040324/gcc: tm_p.h
Only in gcc-3.4-20040324/gcc: tm-preds.h
Only in gcc-3.4-20040324/gcc: toplev.o
Only in gcc-3.4-20040324/gcc: tracer.o
diff -aur gcc-3.4-20040324orig/gcc/tree.c gcc-3.4-20040324/gcc/tree.c
--- gcc-3.4-20040324orig/gcc/tree.c	2004-02-05 22:01:35.000000000 +0000
+++ gcc-3.4-20040324/gcc/tree.c	2004-04-04 14:58:21.000000000 +0100
@@ -2563,6 +2563,10 @@
     layout_decl (t, 0);
   else if (code == FUNCTION_DECL)
     DECL_MODE (t) = FUNCTION_MODE;
+    
+  /* Set default visibility to whatever the user supplied with
+     defined_visibility defaulting to zero.  */
+  DECL_VISIBILITY(t) = default_visibility;
 
   return t;
 }
Only in gcc-3.4-20040324/gcc: tree-check.h
Only in gcc-3.4-20040324/gcc: tree-dump.o
diff -aur gcc-3.4-20040324orig/gcc/tree.h gcc-3.4-20040324/gcc/tree.h
--- gcc-3.4-20040324orig/gcc/tree.h	2004-02-08 01:52:43.000000000 +0000
+++ gcc-3.4-20040324/gcc/tree.h	2004-04-04 15:24:09.000000000 +0100
@@ -1499,6 +1499,10 @@
 /* Value of the decls's visibility attribute */
 #define DECL_VISIBILITY(NODE) (DECL_CHECK (NODE)->decl.visibility)
 
+/* Nonzero means that the decl had its visibility specified rather than
+   being inferred.  */
+#define DECL_VISIBILITYSPECIFIED(NODE) (DECL_CHECK (NODE)->decl.declared_visibility)
+
 /* In a FUNCTION_DECL, nonzero if the function cannot be inlined.  */
 #define DECL_UNINLINABLE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.uninlinable)
 
@@ -1633,7 +1637,8 @@
    || TREE_CODE (DECL_CONTEXT (EXP)) == TRANSLATION_UNIT_DECL)
 
 /* Enumerate visibility settings.  */
-
+#ifndef SYMBOL_VISIBILITY_DEFINED
+#define SYMBOL_VISIBILITY_DEFINED
 enum symbol_visibility
 {
   VISIBILITY_DEFAULT,
@@ -1641,6 +1646,7 @@
   VISIBILITY_HIDDEN,
   VISIBILITY_PROTECTED
 };
+#endif
 
 struct function;
 
@@ -1684,8 +1690,7 @@
   unsigned thread_local_flag : 1;
   unsigned declared_inline_flag : 1;
   ENUM_BITFIELD(symbol_visibility) visibility : 2;
-  unsigned unused : 1;
-  /* one unused bit.  */
+  unsigned declared_visibility : 1;
 
   unsigned lang_flag_0 : 1;
   unsigned lang_flag_1 : 1;
Only in gcc-3.4-20040324/gcc: tree-inline.o
Only in gcc-3.4-20040324/gcc: tree.o
Only in gcc-3.4-20040324/gcc: tree-optimize.o
Only in gcc-3.4-20040324/gcc: unroll.o
Only in gcc-3.4-20040324/gcc: value-prof.o
diff -aur gcc-3.4-20040324orig/gcc/varasm.c gcc-3.4-20040324/gcc/varasm.c
--- gcc-3.4-20040324orig/gcc/varasm.c	2004-01-30 14:23:18.000000000 +0000
+++ gcc-3.4-20040324/gcc/varasm.c	2004-04-04 17:09:41.000000000 +0100
@@ -4473,7 +4473,7 @@
 maybe_assemble_visibility (tree decl)
 {
   enum symbol_visibility vis = DECL_VISIBILITY (decl);
-
+  
   if (vis != VISIBILITY_DEFAULT)
     (* targetm.asm_out.visibility) (decl, vis);
 }
@@ -5148,15 +5148,19 @@
   /* Static variables are always local.  */
   else if (! TREE_PUBLIC (exp))
     local_p = true;
-  /* A variable is local if the user tells us so.  */
-  else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
-    local_p = true;
   /* Otherwise, variables defined outside this object may not be local.  */
   else if (DECL_EXTERNAL (exp))
     local_p = false;
   /* Linkonce and weak data are never local.  */
   else if (DECL_ONE_ONLY (exp) || DECL_WEAK (exp))
     local_p = false;
+  /* If none of the above and visibility is not default, make local.  */
+  else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
+    {
+      /*warning ("Made local symbol %D has visibility=%d, specified=%d, default is=%d\n", exp,
+        DECL_VISIBILITY (exp), DECL_VISIBILITYSPECIFIED (exp), default_visibility);*/
+      local_p = true;
+    }
   /* If PIC, then assume that any global name can be overridden by
      symbols resolved from other modules.  */
   else if (shlib)
Only in gcc-3.4-20040324/gcc: varasm.o
Only in gcc-3.4-20040324/gcc: varray.o
Only in gcc-3.4-20040324/gcc: version.o
Only in gcc-3.4-20040324/gcc: vispatch.diff
Only in gcc-3.4-20040324/gcc: vmsdbgout.o
Only in gcc-3.4-20040324/gcc: web.o
Only in gcc-3.4-20040324/gcc: xcoffout.o
Only in gcc-3.4-20040324/gcc: xgcc
Only in gcc-3.4-20040324/gcc: xlimits.h
Only in gcc-3.4-20040324: i686-pc-linux-gnu
Only in gcc-3.4-20040324/intl: config.cache
Only in gcc-3.4-20040324/intl: config.h
Only in gcc-3.4-20040324/intl: config.intl
Only in gcc-3.4-20040324/intl: config.log
Only in gcc-3.4-20040324/intl: config.status
Only in gcc-3.4-20040324/intl: Makefile
Only in gcc-3.4-20040324/libiberty: alloca.o
Only in gcc-3.4-20040324/libiberty: argv.o
Only in gcc-3.4-20040324/libiberty: choose-temp.o
Only in gcc-3.4-20040324/libiberty: concat.o
Only in gcc-3.4-20040324/libiberty: config.cache
Only in gcc-3.4-20040324/libiberty: config.h
Only in gcc-3.4-20040324/libiberty: config.log
Only in gcc-3.4-20040324/libiberty: config.status
Only in gcc-3.4-20040324/libiberty: cp-demangle.o
Only in gcc-3.4-20040324/libiberty: cp-demint.o
Only in gcc-3.4-20040324/libiberty: cplus-dem.o
Only in gcc-3.4-20040324/libiberty: dyn-string.o
Only in gcc-3.4-20040324/libiberty: fdmatch.o
Only in gcc-3.4-20040324/libiberty: fibheap.o
Only in gcc-3.4-20040324/libiberty: floatformat.o
Only in gcc-3.4-20040324/libiberty: fnmatch.o
Only in gcc-3.4-20040324/libiberty: getopt1.o
Only in gcc-3.4-20040324/libiberty: getopt.o
Only in gcc-3.4-20040324/libiberty: getpwd.o
Only in gcc-3.4-20040324/libiberty: getruntime.o
Only in gcc-3.4-20040324/libiberty: hashtab.o
Only in gcc-3.4-20040324/libiberty: hex.o
Only in gcc-3.4-20040324/libiberty: lbasename.o
Only in gcc-3.4-20040324/libiberty: libiberty.a
Only in gcc-3.4-20040324/libiberty: libiberty.info
Only in gcc-3.4-20040324/libiberty: libiberty.info-1
Only in gcc-3.4-20040324/libiberty: lrealpath.o
Only in gcc-3.4-20040324/libiberty: Makefile
Only in gcc-3.4-20040324/libiberty: make-relative-prefix.o
Only in gcc-3.4-20040324/libiberty: make-temp-file.o
Only in gcc-3.4-20040324/libiberty: md5.o
Only in gcc-3.4-20040324/libiberty: mkstemps.o
Only in gcc-3.4-20040324/libiberty: needed-list
Only in gcc-3.4-20040324/libiberty: objalloc.o
Only in gcc-3.4-20040324/libiberty: obstack.o
Only in gcc-3.4-20040324/libiberty: partition.o
Only in gcc-3.4-20040324/libiberty: pex-unix.o
Only in gcc-3.4-20040324/libiberty: physmem.o
Only in gcc-3.4-20040324/libiberty: regex.o
Only in gcc-3.4-20040324/libiberty: required-list
Only in gcc-3.4-20040324/libiberty: safe-ctype.o
Only in gcc-3.4-20040324/libiberty: sort.o
Only in gcc-3.4-20040324/libiberty: spaces.o
Only in gcc-3.4-20040324/libiberty: splay-tree.o
Only in gcc-3.4-20040324/libiberty: stamp-h
Only in gcc-3.4-20040324/libiberty: stamp-picdir
Only in gcc-3.4-20040324/libiberty: strerror.o
Only in gcc-3.4-20040324/libiberty: strsignal.o
Only in gcc-3.4-20040324/libiberty: ternary.o
Only in gcc-3.4-20040324/libiberty/testsuite: Makefile
Only in gcc-3.4-20040324/libiberty/testsuite: test-demangle
Only in gcc-3.4-20040324/libiberty: xatexit.o
Only in gcc-3.4-20040324/libiberty: xexit.o
Only in gcc-3.4-20040324/libiberty: xhost-mkfrag
Only in gcc-3.4-20040324/libiberty: xmalloc.o
Only in gcc-3.4-20040324/libiberty: xmemdup.o
Only in gcc-3.4-20040324/libiberty: xstrdup.o
Only in gcc-3.4-20040324/libiberty: xstrerror.o
Only in gcc-3.4-20040324: Makefile
Only in gcc-3.4-20040324: maybedep.tmp
Only in gcc-3.4-20040324: multilib.out
Only in gcc-3.4-20040324: serdep.tmp

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]