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]

[OBJC] Fix visibility issue


Hi,
objc-act sets DECL_COMMON flag and do not set DECL_PUBLIC
and also sets DECL_INITIAL.  Per comment on DECL_COMMON:
/* Nonzero for a given ..._DECL node means that this node should be
   put in .common, if possible.  If a DECL_INITIAL is given, and it
   is not error_mark_node, then the decl cannot be put in .common.  */

this does not make much sense.

Bootstrapping/regtesting x86_64-linux, OK if passes?

	* objc-act.c (objc_add_static_instance): Do not set DECL_COMMON.

Index: objc-act.c
===================================================================
--- objc-act.c	(revision 154122)
+++ objc-act.c	(working copy)
@@ -2038,7 +2038,6 @@ objc_add_static_instance (tree construct
   sprintf (buf, "_OBJC_INSTANCE_%d", num_static_inst++);
   decl = build_decl (input_location,
 		     VAR_DECL, get_identifier (buf), class_decl);
-  DECL_COMMON (decl) = 1;
   TREE_STATIC (decl) = 1;
   DECL_ARTIFICIAL (decl) = 1;
   TREE_USED (decl) = 1;


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