diff options
Diffstat (limited to 'gcc/ipa-fnsummary.c')
-rw-r--r-- | gcc/ipa-fnsummary.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c index 55a0b27..49bab04 100644 --- a/gcc/ipa-fnsummary.c +++ b/gcc/ipa-fnsummary.c @@ -82,6 +82,7 @@ along with GCC; see the file COPYING3. If not see #include "gimplify.h" #include "stringpool.h" #include "attribs.h" +#include <vector> #include "tree-into-ssa.h" /* Summaries. */ @@ -330,7 +331,7 @@ static void evaluate_conditions_for_known_args (struct cgraph_node *node, bool inline_p, vec<tree> known_vals, - vec<value_range> known_value_ranges, + const std::vector<value_range> &known_value_ranges, vec<ipa_agg_value_set> known_aggs, clause_t *ret_clause, clause_t *ret_nonspec_clause) @@ -445,7 +446,7 @@ evaluate_conditions_for_known_args (struct cgraph_node *node, continue; } } - if (c->operand_num < (int) known_value_ranges.length () + if (c->operand_num < (int) known_value_ranges.size () && !c->agg_contents && !known_value_ranges[c->operand_num].undefined_p () && !known_value_ranges[c->operand_num].varying_p () @@ -554,7 +555,7 @@ evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p, { struct cgraph_node *callee = e->callee->ultimate_alias_target (); class ipa_fn_summary *info = ipa_fn_summaries->get (callee); - auto_vec<value_range, 32> known_value_ranges; + std::vector<value_range> known_value_ranges (32); class ipa_edge_args *args; if (clause_ptr) @@ -629,8 +630,12 @@ evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p, i)); if (!vr.undefined_p () && !vr.varying_p ()) { - if (!known_value_ranges.length ()) - known_value_ranges.safe_grow_cleared (count); + if (!known_value_ranges.size ()) + { + known_value_ranges.resize (count); + for (int i = 0; i < count; ++i) + known_value_ranges[i].set_undefined (); + } known_value_ranges[i] = vr; } } @@ -803,7 +808,7 @@ ipa_fn_summary_t::duplicate (cgraph_node *src, } evaluate_conditions_for_known_args (dst, false, known_vals, - vNULL, + std::vector<value_range> (), vNULL, &possible_truths, /* We are going to specialize, @@ -3687,7 +3692,8 @@ estimate_ipcp_clone_size_and_time (struct cgraph_node *node, clause_t clause, nonspec_clause; /* TODO: Also pass known value ranges. */ - evaluate_conditions_for_known_args (node, false, known_vals, vNULL, + evaluate_conditions_for_known_args (node, false, known_vals, + std::vector<value_range> (), known_aggs, &clause, &nonspec_clause); ipa_call_context ctx (node, clause, nonspec_clause, known_vals, known_contexts, |