diff options
author | Jan Hubicka <hubicka@gcc.gnu.org> | 2006-10-15 16:20:06 +0000 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2006-10-15 16:20:06 +0000 |
commit | 61e00a5e0d9676dacd7e407d6b797146f10aae7f (patch) | |
tree | 40fc048501d66f0b1d5def16d9ebe2a7ba1b8202 /gcc/cgraphunit.c | |
parent | 70c99f6c02013c9de34ce838732dd370d7ca379e (diff) | |
download | gcc-61e00a5e0d9676dacd7e407d6b797146f10aae7f.zip gcc-61e00a5e0d9676dacd7e407d6b797146f10aae7f.tar.gz gcc-61e00a5e0d9676dacd7e407d6b797146f10aae7f.tar.bz2 |
re PR middle-end/29299 (gcc "used" attribute has no effect on local-scope static variables)
PR middle-end/29299
* cgraphunit.c (cgraph_finalize_compilation_unit): Call
process_function_and_variable_attributes on all variables, including
those discovered during cgraph construction phase.
From-SVN: r117746
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r-- | gcc/cgraphunit.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 10c52ea..d7ad793 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1055,6 +1055,7 @@ cgraph_finalize_compilation_unit (void) /* Keep track of already processed nodes when called multiple times for intermodule optimization. */ static struct cgraph_node *first_analyzed; + struct cgraph_node *first_processed = first_analyzed; static struct cgraph_varpool_node *first_analyzed_var; if (errorcount || sorrycount) @@ -1077,7 +1078,10 @@ cgraph_finalize_compilation_unit (void) } timevar_push (TV_CGRAPH); - process_function_and_variable_attributes (first_analyzed, first_analyzed_var); + process_function_and_variable_attributes (first_processed, + first_analyzed_var); + first_processed = cgraph_nodes; + first_analyzed_var = cgraph_varpool_nodes; cgraph_varpool_analyze_pending_decls (); if (cgraph_dump_file) { @@ -1119,11 +1123,16 @@ cgraph_finalize_compilation_unit (void) if (!edge->callee->reachable) cgraph_mark_reachable_node (edge->callee); + /* We finalize local static variables during constructing callgraph + edges. Process their attributes too. */ + process_function_and_variable_attributes (first_processed, + first_analyzed_var); + first_processed = cgraph_nodes; + first_analyzed_var = cgraph_varpool_nodes; cgraph_varpool_analyze_pending_decls (); } - /* Collect entry points to the unit. */ - +/bin/bash: line 1: :Q: command not found if (cgraph_dump_file) { fprintf (cgraph_dump_file, "Unit entry points:"); @@ -1163,7 +1172,6 @@ cgraph_finalize_compilation_unit (void) dump_cgraph (cgraph_dump_file); } first_analyzed = cgraph_nodes; - first_analyzed_var = cgraph_varpool_nodes; ggc_collect (); timevar_pop (TV_CGRAPH); } |