This is the mail archive of the 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]

[PATCH] Fix externally_visible, part 2 (PR c/28744)


Further investigation showed that there is another problem,
while all the variables in attr-externally-visible-1.c are now
globally visible, the functions with the exception of main are
compiled in, but not visible (missing .globl).
The problem seems to be that we have too many externally_visible
There is one in struct cgraph_varpool_node (ok), one in
struct cgraph_node and one in struct cgraph_local_info (which
is contained in struct cgraph_node).
The code was using node->local.externally_visible in all places
but one - process_function_and_variable_attributes.
The following patch kills the other bitfield, so that it won't
confuse and adjusts the one place which was accessing the
wrong bitfield.  The patch is on top of my previous PR c/28744
patch, but could be applied by hand even on top of stock trunk.

Ok for trunk?

2006-08-16  Jakub Jelinek  <>

	PR c/28744
	* cgraph.h (struct cgraph_node): Remove externally_visible
	* cgraphunit.c (process_function_and_variable_attributes): Set
	local.externally_visible rather than externally_visible.

--- gcc/cgraph.h.jj	2006-08-07 15:08:38.000000000 +0200
+++ gcc/cgraph.h	2006-08-16 15:05:31.000000000 +0200
@@ -160,8 +160,6 @@ struct cgraph_node GTY((chain_next ("%h.
   unsigned analyzed : 1;
   /* Set when function is scheduled to be assembled.  */
   unsigned output : 1;
-  /* Set when function is visible by other units.  */
-  unsigned externally_visible : 1;
   /* Set for aliases once they got through assemble_alias.  */
   unsigned alias : 1;
--- gcc/cgraphunit.c.jj	2006-08-16 11:56:56.000000000 +0200
+++ gcc/cgraphunit.c	2006-08-16 15:07:28.000000000 +0200
@@ -993,7 +993,7 @@ process_function_and_variable_attributes
 	      if (node->local.finalized)
 		cgraph_mark_needed_node (node);
-	      node->externally_visible = true;
+	      node->local.externally_visible = true;


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