diff options
author | froydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-24 23:37:02 +0000 |
---|---|---|
committer | froydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-24 23:37:02 +0000 |
commit | d304b9e1af728d54ec16155c3d2116dc398c33c6 (patch) | |
tree | f5e6b65d440def829e0dc9d896d1a600cc578ba4 /gcc/function.c | |
parent | 3064d0d2bef8624a5b94620e1567e91ad66ca8d4 (diff) | |
download | gcc-d304b9e1af728d54ec16155c3d2116dc398c33c6.tar.gz |
* function.c (instantiate_virtual_regs): Use FOR_EACH_BB and
FOR_BB_INSNS_SAFE to iterate through insns. Re-indent.
(pass_instantiate_virtual_regs): Require PROP_cfglayout.
* passes.c (init_optimization_passes): Move
pass_instantiate_virtual_regs after pass_into_cfg_layout_mode.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171426 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 59 |
1 files changed, 33 insertions, 26 deletions
diff --git a/gcc/function.c b/gcc/function.c index a1ea482acad..49404c873ff 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1883,7 +1883,7 @@ instantiate_decls (tree fndecl) static unsigned int instantiate_virtual_regs (void) { - rtx insn; + basic_block bb; /* Compute the offsets to use for this function. */ in_arg_offset = FIRST_PARM_OFFSET (current_function_decl); @@ -1901,33 +1901,40 @@ instantiate_virtual_regs (void) /* Scan through all the insns, instantiating every virtual register still present. */ - for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) - if (INSN_P (insn)) - { - /* These patterns in the instruction stream can never be recognized. - Fortunately, they shouldn't contain virtual registers either. */ - if (GET_CODE (PATTERN (insn)) == USE - || GET_CODE (PATTERN (insn)) == CLOBBER - || GET_CODE (PATTERN (insn)) == ADDR_VEC - || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC - || GET_CODE (PATTERN (insn)) == ASM_INPUT) - continue; - else if (DEBUG_INSN_P (insn)) - for_each_rtx (&INSN_VAR_LOCATION (insn), - instantiate_virtual_regs_in_rtx, NULL); - else - instantiate_virtual_regs_in_insn (insn); + FOR_EACH_BB (bb) + { + rtx insn, curr; - if (INSN_DELETED_P (insn)) - continue; + FOR_BB_INSNS_SAFE (bb, insn, curr) + { + if (INSN_P (insn)) + { + /* These patterns in the instruction stream can never be recognized. + Fortunately, they shouldn't contain virtual registers either. */ + if (GET_CODE (PATTERN (insn)) == USE + || GET_CODE (PATTERN (insn)) == CLOBBER + || GET_CODE (PATTERN (insn)) == ADDR_VEC + || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC + || GET_CODE (PATTERN (insn)) == ASM_INPUT) + continue; + else if (DEBUG_INSN_P (insn)) + for_each_rtx (&INSN_VAR_LOCATION (insn), + instantiate_virtual_regs_in_rtx, NULL); + else + instantiate_virtual_regs_in_insn (insn); - for_each_rtx (®_NOTES (insn), instantiate_virtual_regs_in_rtx, NULL); + if (INSN_DELETED_P (insn)) + continue; - /* Instantiate any virtual registers in CALL_INSN_FUNCTION_USAGE. */ - if (CALL_P (insn)) - for_each_rtx (&CALL_INSN_FUNCTION_USAGE (insn), - instantiate_virtual_regs_in_rtx, NULL); - } + for_each_rtx (®_NOTES (insn), instantiate_virtual_regs_in_rtx, NULL); + + /* Instantiate any virtual registers in CALL_INSN_FUNCTION_USAGE. */ + if (CALL_P (insn)) + for_each_rtx (&CALL_INSN_FUNCTION_USAGE (insn), + instantiate_virtual_regs_in_rtx, NULL); + } + } + } /* Instantiate the virtual registers in the DECLs for debugging purposes. */ instantiate_decls (current_function_decl); @@ -1963,7 +1970,7 @@ struct rtl_opt_pass pass_instantiate_virtual_regs = NULL, /* next */ 0, /* static_pass_number */ TV_NONE, /* tv_id */ - 0, /* properties_required */ + PROP_cfglayout, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ |