From 3d1c0354cfb3b1f6959ed25a13b0d250cf725130 Mon Sep 17 00:00:00 2001 From: hubicka Date: Wed, 9 May 2012 07:01:39 +0000 Subject: * cgraphbuild.c (build_cgraph_edges): Do not finalize vars with VALUE_EXPR. * cgraph.h (varpool_can_remove_if_no_refs): Vars with VALUE_EXPR are removable. * toplev.c (wrapup_global_declaration_2): Vars with VALUE_EXPR need to wrapup. (compile_file): Do not output variables. * cgraphbuild.c (varpool_finalize_decl): When var is finalized late, output it. * langhooks.c: Include timevar.h (write_global_declarations): Finalize compilation unit after wrapup; set timevars correctly. * passes.c (rest_of_decl_compilation): Decls with VALUE_EXPR needs not to be added to varpool. * varpool.c (varpool_assemble_decl): Sanity check that we are called only on cases where it makes sense; skip constant pool and value expr vars. * lto.c (do_whole_program_analysis): Set timevars correctly. (lto_main): Likewise. * trans-common.c (create_common): Do not fake TREE_ASM_WRITTEN. * trans-decl.c (gfc_finish_cray_pointee): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187314 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cgraphunit.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/cgraphunit.c') diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 4c44d91af51..781ca4bda5f 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -834,6 +834,10 @@ varpool_finalize_decl (tree decl) enqueue_node ((symtab_node)node); if (cgraph_state >= CGRAPH_STATE_IPA_SSA) varpool_analyze_node (node); + /* Some frontends produce various interface variables after compilation + finished. */ + if (cgraph_state == CGRAPH_STATE_FINISHED) + varpool_assemble_decl (node); } /* Discover all functions and variables that are trivially needed, analyze -- cgit v1.2.3