aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/ipa-cp.c
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2014-06-18 13:00:04 -0700
committerPavel Chupin <pavel.v.chupin@intel.com>2014-06-19 22:38:42 +0400
commitf190d6284359da8ae8694b2d2e14b01602a959ed (patch)
treed4e0548e7cec02d60b1082368032e66a1c509a02 /gcc-4.8/gcc/ipa-cp.c
parent4ff2f42147bc128ce38789071d98e55844cd3a5e (diff)
downloadtoolchain_gcc-f190d6284359da8ae8694b2d2e14b01602a959ed.tar.gz
toolchain_gcc-f190d6284359da8ae8694b2d2e14b01602a959ed.tar.bz2
toolchain_gcc-f190d6284359da8ae8694b2d2e14b01602a959ed.zip
Merge GCC 4.8.3
Change-Id: I0abe59f7705b3eccc6b2f123af75b2e30917696a
Diffstat (limited to 'gcc-4.8/gcc/ipa-cp.c')
-rw-r--r--gcc-4.8/gcc/ipa-cp.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/gcc-4.8/gcc/ipa-cp.c b/gcc-4.8/gcc/ipa-cp.c
index 7ea66f8cb..23d3e4d93 100644
--- a/gcc-4.8/gcc/ipa-cp.c
+++ b/gcc-4.8/gcc/ipa-cp.c
@@ -444,6 +444,9 @@ determine_versionability (struct cgraph_node *node)
reason = "not a tree_versionable_function";
else if (cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE)
reason = "insufficient body availability";
+ else if (!opt_for_fn (node->symbol.decl, optimize)
+ || !opt_for_fn (node->symbol.decl, flag_ipa_cp))
+ reason = "non-optimized function";
if (reason && dump_file && !node->alias && !node->thunk.thunk_p)
fprintf (dump_file, "Function %s/%i is not versionable, reason: %s.\n",
@@ -1455,22 +1458,21 @@ propagate_constants_accross_call (struct cgraph_edge *cs)
args_count = ipa_get_cs_argument_count (args);
parms_count = ipa_get_param_count (callee_info);
- /* If this call goes through a thunk we must not propagate to the first (0th)
- parameter. However, we might need to uncover a thunk from below a series
- of aliases first. */
+ /* If this call goes through a thunk we should not propagate because we
+ cannot redirect edges to thunks. However, we might need to uncover a
+ thunk from below a series of aliases first. */
alias_or_thunk = cs->callee;
while (alias_or_thunk->alias)
alias_or_thunk = cgraph_alias_aliased_node (alias_or_thunk);
if (alias_or_thunk->thunk.thunk_p)
{
+ for (i = 0; i < parms_count; i++)
ret |= set_all_contains_variable (ipa_get_parm_lattices (callee_info,
- 0));
- i = 1;
+ i));
+ return ret;
}
- else
- i = 0;
- for (; (i < args_count) && (i < parms_count); i++)
+ for (i = 0; (i < args_count) && (i < parms_count); i++)
{
struct ipa_jump_func *jump_func = ipa_get_ith_jump_func (args, i);
struct ipcp_param_lattices *dest_plats;
@@ -3119,6 +3121,7 @@ cgraph_edge_brings_all_agg_vals_for_node (struct cgraph_edge *cs,
struct cgraph_node *node)
{
struct ipa_node_params *orig_caller_info = IPA_NODE_REF (cs->caller);
+ struct ipa_node_params *orig_node_info;
struct ipa_agg_replacement_value *aggval;
int i, ec, count;
@@ -3133,6 +3136,7 @@ cgraph_edge_brings_all_agg_vals_for_node (struct cgraph_edge *cs,
if (aggval->index >= ec)
return false;
+ orig_node_info = IPA_NODE_REF (IPA_NODE_REF (node)->ipcp_orig_node);
if (orig_caller_info->ipcp_orig_node)
orig_caller_info = IPA_NODE_REF (orig_caller_info->ipcp_orig_node);
@@ -3150,7 +3154,7 @@ cgraph_edge_brings_all_agg_vals_for_node (struct cgraph_edge *cs,
if (!interesting)
continue;
- plats = ipa_get_parm_lattices (orig_caller_info, aggval->index);
+ plats = ipa_get_parm_lattices (orig_node_info, aggval->index);
if (plats->aggs_bottom)
return false;