aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2003-09-09 02:31:39 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2003-09-09 00:31:39 +0000
commitd853a20e6cf622329c8f005cc97be8813f935323 (patch)
tree623ba3114b93c04e4e5929e3ff36073432517a82 /gcc/cgraph.c
parentc05e3efaa4bf6c6ad3ebad148a44d84b4054c799 (diff)
downloadgcc-d853a20e6cf622329c8f005cc97be8813f935323.zip
gcc-d853a20e6cf622329c8f005cc97be8813f935323.tar.gz
gcc-d853a20e6cf622329c8f005cc97be8813f935323.tar.bz2
cgraph.c (cgraph_varpool_finalize_decl): Sanity check duplicated finalization.
* cgraph.c (cgraph_varpool_finalize_decl): Sanity check duplicated finalization. * cgraphunit.c (decide_is_fnction_needed): Avoid special case of nested functions, check for COMDAT. (cgraph_assemble_pending_functions): Break out from... (cgraph_finalize_function): ... here; allow redefinig of extern inline functions. (record_call_1): Record function references only in non-unit-at-a-time mode. (cgraph_analyze_function): Reset current_function_decl. (cgraph_finalize_compilation_unit): Assemble pending functions. From-SVN: r71221
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 4eaa60e..52a3bf6 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -481,8 +481,14 @@ void
cgraph_varpool_finalize_decl (tree decl)
{
struct cgraph_varpool_node *node = cgraph_varpool_node (decl);
-
- if (node->needed && !node->finalized)
+
+ /* The first declaration of a variable that comes through this function
+ decides whether it is global (in C, has external linkage)
+ or local (in C, has internal linkage). So do nothing more
+ if this function has already run. */
+ if (node->finalized)
+ return;
+ if (node->needed)
{
node->next_needed = cgraph_varpool_nodes_queue;
cgraph_varpool_nodes_queue = node;