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/builtins.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/builtins.c')
-rw-r--r-- | gcc/builtins.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 2ae99ba..7ccdded 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -45,6 +45,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tm_p.h" #include "target.h" #include "langhooks.h" +#include "basic-block.h" #define CALLED_AS_BUILT_IN(NODE) \ (!strncmp (IDENTIFIER_POINTER (DECL_NAME (NODE)), "__builtin_", 10)) @@ -1206,6 +1207,13 @@ expand_builtin_apply_args_1 (void) return copy_addr_to_reg (XEXP (registers, 0)); } +/* Return RTX to emit after when we want to emit code on the entry of function. */ +static rtx +entry_of_function (void) +{ + return (n_basic_blocks ? BB_HEAD (ENTRY_BLOCK_PTR->next_bb) : get_insns ()); +} + /* __builtin_apply_args returns block of memory allocated on the stack into which is stored the arg pointer, structure value address, static chain, and all the registers that might @@ -1239,7 +1247,7 @@ expand_builtin_apply_args (void) chain current, so the code is placed at the start of the function. */ push_topmost_sequence (); - emit_insn_before (seq, NEXT_INSN (get_insns ())); + emit_insn_before (seq, NEXT_INSN (entry_of_function ())); pop_topmost_sequence (); return temp; } @@ -4010,7 +4018,7 @@ expand_builtin_saveregs (void) is inside a start_sequence, make the outer-level insn chain current, so the code is placed at the start of the function. */ push_topmost_sequence (); - emit_insn_after (seq, get_insns ()); + emit_insn_after (seq, entry_of_function ()); pop_topmost_sequence (); return val; |