diff options
author | Jan Hubicka <hubicka@gcc.gnu.org> | 2004-06-19 15:33:06 +0000 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2004-06-19 15:33:06 +0000 |
commit | 242229bbdc6beacddb4ed263c759d3ca52dae927 (patch) | |
tree | 2ee8a7629143f7f2514ddf9a48376c6ac3d11bc0 /gcc/expr.c | |
parent | ff98621c682005e2a224f62c1aa5028353a5357e (diff) | |
download | gcc-242229bbdc6beacddb4ed263c759d3ca52dae927.zip gcc-242229bbdc6beacddb4ed263c759d3ca52dae927.tar.gz gcc-242229bbdc6beacddb4ed263c759d3ca52dae927.tar.bz2 |
CFG transparent RTL expansion:
* Makefile.in (cfgexpand.o): New object file.
(builtins.o): Add dependency on basic-block.h
* builtins.c: Include basic-block.h
(entry_of_function): New function.
(expand_builtin_apply_args, expand_builtin_saveargs): Use it.
* cfgexpand.c: New file.
* expr.c (execute_expand, pass_expand): Kill.
* pass.c (rest_of_compilation): Do not build CFG unless called from
coverage code.
* tree-cfg.c (delete_tree_cfg): Rename to..
(delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself.
* tree-flow.h (delete_tree_cfg_annotations): Declare.
(dleete_tree_cfg): Kill.
* tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill.
(execute_del_cfg): Rename to...
(execute_free_datastructures): This one...
(pass_del_cfg): Rename to...
(pass_free_datastructures): ... this one; Do not kill PROP_cfg.
(init_tree_optimization_passes): Make cfg build and profiling to happen
unconditionally.
* tree-mudflap.c (mf_decl_cache_locals): Skip labels before
inserting the cache variables.
* tree-mudflap.c: Include headers to make basic_block available.
Move functions around such that related functions are near each
other. Add prototypes for all static functions. Add comments
briefly explaining what IR the mudflap1 and mudflap2 work on and
what they do.
(mudflap_function_decls): Rename to execute_mudflap_function_decls.
(mudflap_function_ops): Rename to execute_mudflap_function_ops.
(pass_mudflap_1, pass_mudflap_2): Update.
(mf_decl_cache_locals): Make it work on the CFG instead of the saved
function tree.
(mf_build_check_statement_for): Make it work on the CFG.
(mf_xform_derefs_1): Likewise. Cleanup code style.
(mf_xform_derefs): Likewise.
* tree-cfg.c (label_to_block): Invent the label destination for
undefined labels.
(cleanup_dead_labels): Update table in the case label_to_block added
new label.
From-SVN: r83385
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 89 |
1 files changed, 0 insertions, 89 deletions
@@ -168,7 +168,6 @@ static void emit_single_push_insn (enum machine_mode, rtx, tree); #endif static void do_tablejump (rtx, enum machine_mode, rtx, rtx, rtx); static rtx const_vector_from_tree (tree); -static void execute_expand (void); /* Record for each mode whether we can move a register directly to or from an object of that mode in memory. If we can't, we won't try @@ -10213,92 +10212,4 @@ const_vector_from_tree (tree exp) return gen_rtx_raw_CONST_VECTOR (mode, v); } - -/* Called to move the SAVE_EXPRs for parameter declarations in a - nested function into the nested function. DATA is really the - nested FUNCTION_DECL. */ - -static tree -set_save_expr_context (tree *tp, - int *walk_subtrees, - void *data) -{ - if (TREE_CODE (*tp) == SAVE_EXPR && !SAVE_EXPR_CONTEXT (*tp)) - SAVE_EXPR_CONTEXT (*tp) = (tree) data; - /* Do not walk back into the SAVE_EXPR_CONTEXT; that will cause - circularity. */ - else if (DECL_P (*tp)) - *walk_subtrees = 0; - - return NULL; -} - - -static void -execute_expand (void) -{ - /* If the function has a variably modified type, there may be - SAVE_EXPRs in the parameter types. Their context must be set to - refer to this function; they cannot be expanded in the containing - function. */ - if (decl_function_context (current_function_decl) == current_function_decl - && variably_modified_type_p (TREE_TYPE (current_function_decl))) - walk_tree (&TREE_TYPE (current_function_decl), set_save_expr_context, - current_function_decl, NULL); - - /* Expand the variables recorded during gimple lowering. This must - occur before the call to expand_function_start to ensure that - all used variables are expanded before we expand anything on the - PENDING_SIZES list. */ - expand_used_vars (); - - /* Set up parameters and prepare for return, for the function. */ - expand_function_start (current_function_decl, 0); - - /* If this function is `main', emit a call to `__main' - to run global initializers, etc. */ - if (DECL_NAME (current_function_decl) - && MAIN_NAME_P (DECL_NAME (current_function_decl)) - && DECL_FILE_SCOPE_P (current_function_decl)) - expand_main_function (); - - /* Generate the RTL for this function. */ - expand_expr_stmt_value (DECL_SAVED_TREE (current_function_decl), 0, 0); - - /* We hard-wired immediate_size_expand to zero above. - expand_function_end will decrement this variable. So, we set the - variable to one here, so that after the decrement it will remain - zero. */ - immediate_size_expand = 1; - - /* Make sure the locus is set to the end of the function, so that - epilogue line numbers and warnings are set properly. */ - if (cfun->function_end_locus.file) - input_location = cfun->function_end_locus; - - /* The following insns belong to the top scope. */ - record_block_change (DECL_INITIAL (current_function_decl)); - - /* Generate rtl for function exit. */ - expand_function_end (); -} - -struct tree_opt_pass pass_expand = -{ - "expand", /* name */ - NULL, /* gate */ - execute_expand, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - TV_EXPAND, /* tv_id */ - /* ??? If TER is enabled, we actually receive GENERIC. */ - PROP_gimple_leh, /* properties_required */ - PROP_rtl, /* properties_provided */ - PROP_cfg | PROP_gimple_leh, /* properties_destroyed */ - 0, /* todo_flags_start */ - 0 /* todo_flags_finish */ -}; - - #include "gt-expr.h" |