aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2012-05-09 09:01:39 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2012-05-09 07:01:39 +0000
commit0d6bf48c3ea3b48f462be944e46ced4bf3f08884 (patch)
treee597dfea9b0d87794f19fd362d4d0233467a72af /gcc/toplev.c
parent36e0c0a5157a20eda403d230392327c73a9b9e12 (diff)
downloadgcc-0d6bf48c3ea3b48f462be944e46ced4bf3f08884.zip
gcc-0d6bf48c3ea3b48f462be944e46ced4bf3f08884.tar.gz
gcc-0d6bf48c3ea3b48f462be944e46ced4bf3f08884.tar.bz2
cgraphbuild.c (build_cgraph_edges): Do not finalize vars with VALUE_EXPR.
* 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. From-SVN: r187314
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index a2845ab..90b2246 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -364,7 +364,8 @@ wrapup_global_declaration_1 (tree decl)
bool
wrapup_global_declaration_2 (tree decl)
{
- if (TREE_ASM_WRITTEN (decl) || DECL_EXTERNAL (decl))
+ if (TREE_ASM_WRITTEN (decl) || DECL_EXTERNAL (decl)
+ || (TREE_CODE (decl) == VAR_DECL && DECL_HAS_VALUE_EXPR_P (decl)))
return false;
/* Don't write out static consts, unless we still need them.
@@ -576,7 +577,6 @@ compile_file (void)
basically finished. */
if (in_lto_p || !flag_lto || flag_fat_lto_objects)
{
- varpool_output_variables ();
finish_aliases_2 ();
/* Likewise for mudflap static object registrations. */