This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix externally_visible, part 2 (PR c/28744)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jan Hubicka <jh at suse dot cz>
- Date: Wed, 16 Aug 2006 09:16:37 -0400
- Subject: [PATCH] Fix externally_visible, part 2 (PR c/28744)
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
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
bitfields.
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 <jakub@redhat.com>
PR c/28744
* cgraph.h (struct cgraph_node): Remove externally_visible
bitfield.
* 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;
}
}
}
Jakub