diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-12 15:20:48 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-12 15:20:48 +0000 |
commit | cb24521686308314fadcd96cdfd23858aa19aa95 (patch) | |
tree | a5f4bc000b917f934f12c45b1b6e764ac0256de6 /gcc/tree-ssa-structalias.c | |
parent | d160af417cc4bcaec9f15e6a21e566cfe106f7c8 (diff) | |
download | gcc-cb24521686308314fadcd96cdfd23858aa19aa95.tar.gz |
2010-04-12 Richard Guenther <rguenther@suse.de>
* gsstruct.def (GSS_CALL): New.
* gimple.def (GIMPLE_CALL): Change to GSS_CALL.
* gimple.h: Include tree-ssa-alias.h.
(struct gimple_statement_call): New.
(union gimple_statement_struct_d): Add gimple_call member.
(gimple_call_reset_alias_info): Declare.
(gimple_call_use_set): New function.
(gimple_call_clobber_set): Likewise.
* Makefile.in (GIMPLE_H): Add tree-ssa-alias.h.
* gimple.c (gimple_call_reset_alias_info): New function.
(gimple_build_call_1): Call it.
* lto-streamer-in.c (input_gimple_stmt): Likewise.
* tree-inline.c (remap_gimple_stmt): Likewise.
(expand_call_inline): Remove callused handling.
* cfgexpand.c (update_alias_info_with_stack_vars): Likewise.
* tree-dfa.c (dump_variable): Likewise.
* tree-parloops.c (parallelize_loops): Likewise.
* tree-ssa.c (init_tree_ssa): Likewise.
(delete_tree_ssa): Likewise.
* tree-flow-inline.h (is_call_used): Remove.
* tree-flow.h (struct gimple_df): Remove callused member.
* tree-nrv.c (dest_safe_for_nrv_p): Adjust predicate.
* tree-ssa-alias.c (dump_alias_info): Remove callused handling.
(ref_maybe_used_by_call_p_1): Simplify.
(call_may_clobber_ref_p_1): Likewise.
* tree-ssa-structalias.c (compute_points_to_sets): Set
the call stmt used and clobbered sets.
* tree-tailcall.c (suitable_for_tail_opt_p): Adjust predicate.
(find_tail_calls): Verify the tail call.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158226 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 2384099a242..e14b97a97f5 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -5480,6 +5480,7 @@ compute_points_to_sets (void) basic_block bb; unsigned i; varinfo_t vi; + struct pt_solution callused; timevar_push (TV_TREE_PTA); @@ -5516,8 +5517,7 @@ compute_points_to_sets (void) call-clobber analysis. */ find_what_var_points_to (get_varinfo (escaped_id), &cfun->gimple_df->escaped); - find_what_var_points_to (get_varinfo (callused_id), - &cfun->gimple_df->callused); + find_what_var_points_to (get_varinfo (callused_id), &callused); /* Make sure the ESCAPED solution (which is used as placeholder in other solutions) does not reference itself. This simplifies @@ -5541,6 +5541,48 @@ compute_points_to_sets (void) find_what_p_points_to (ptr); } + /* Compute the call-used/clobbered sets. */ + FOR_EACH_BB (bb) + { + gimple_stmt_iterator gsi; + + for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) + { + gimple stmt = gsi_stmt (gsi); + struct pt_solution *pt; + if (!is_gimple_call (stmt)) + continue; + + pt = gimple_call_use_set (stmt); + if (gimple_call_flags (stmt) & ECF_CONST) + memset (pt, 0, sizeof (struct pt_solution)); + else if (gimple_call_flags (stmt) & ECF_PURE) + { + /* For const calls we should now be able to compute the + call-used set per function. */ + *pt = callused; + /* ??? ESCAPED can be empty even though NONLOCAL + always escaped. */ + pt->nonlocal = 1; + pt->escaped = 1; + } + else + { + *pt = cfun->gimple_df->escaped; + pt->nonlocal = 1; + } + + pt = gimple_call_clobber_set (stmt); + if (gimple_call_flags (stmt) & (ECF_CONST|ECF_PURE|ECF_NOVOPS)) + memset (pt, 0, sizeof (struct pt_solution)); + else + { + *pt = cfun->gimple_df->escaped; + pt->nonlocal = 1; + } + } + } + timevar_pop (TV_TREE_PTA); } |