Commit d028561e by Jan Hubicka Committed by Jan Hubicka

re PR tree-optimization/51680 (g++ 4.7 fails to inline trivial template stuff)


	PR tree-optimize/51680
	* ipa-inline-analyss.c (evaluate_properties_for_edge): Fix conditoin on when
	known_vals needs to be computed; cleanup.

From-SVN: r182995
parent 3e31d3ba
2012-01-08 Jan Hubicka <jh@suse.cz> 2012-01-08 Jan Hubicka <jh@suse.cz>
PR tree-optimize/51680
* ipa-inline-analyss.c (evaluate_properties_for_edge): Fix conditoin on when
known_vals needs to be computed; cleanup.
2012-01-08 Jan Hubicka <jh@suse.cz>
PR tree-optimize/51694 PR tree-optimize/51694
* ipa-cp.c (ipa_get_indirect_edge_target): Add bounds checks. * ipa-cp.c (ipa_get_indirect_edge_target): Add bounds checks.
...@@ -718,7 +718,7 @@ evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p, ...@@ -718,7 +718,7 @@ evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p,
{ {
struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, NULL); struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, NULL);
struct inline_summary *info = inline_summary (callee); struct inline_summary *info = inline_summary (callee);
int i; VEC (tree, heap) *known_vals = NULL;
if (clause_ptr) if (clause_ptr)
*clause_ptr = inline_p ? 0 : 1 << predicate_not_inlined_condition; *clause_ptr = inline_p ? 0 : 1 << predicate_not_inlined_condition;
...@@ -728,13 +728,13 @@ evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p, ...@@ -728,13 +728,13 @@ evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p,
*known_binfos_ptr = NULL; *known_binfos_ptr = NULL;
if (ipa_node_params_vector if (ipa_node_params_vector
&& !e->call_stmt_cannot_inline_p
&& ((clause_ptr && info->conds) || known_vals_ptr || known_binfos_ptr)) && ((clause_ptr && info->conds) || known_vals_ptr || known_binfos_ptr))
{ {
struct ipa_node_params *parms_info; struct ipa_node_params *parms_info;
struct ipa_edge_args *args = IPA_EDGE_REF (e); struct ipa_edge_args *args = IPA_EDGE_REF (e);
struct inline_edge_summary *es = inline_edge_summary (e); struct inline_edge_summary *es = inline_edge_summary (e);
int i, count = ipa_get_cs_argument_count (args); int i, count = ipa_get_cs_argument_count (args);
VEC (tree, heap) *known_vals = NULL;
if (e->caller->global.inlined_to) if (e->caller->global.inlined_to)
parms_info = IPA_NODE_REF (e->caller->global.inlined_to); parms_info = IPA_NODE_REF (e->caller->global.inlined_to);
...@@ -752,9 +752,9 @@ evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p, ...@@ -752,9 +752,9 @@ evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p,
ipa_get_ith_jump_func (args, i)); ipa_get_ith_jump_func (args, i));
if (cst) if (cst)
{ {
if (info->conds && TREE_CODE (cst) != TREE_BINFO) if (known_vals && TREE_CODE (cst) != TREE_BINFO)
VEC_replace (tree, known_vals, i, cst); VEC_replace (tree, known_vals, i, cst);
else if (known_binfos_ptr != NULL) else if (known_binfos_ptr != NULL && TREE_CODE (cst) == TREE_BINFO)
VEC_replace (tree, *known_binfos_ptr, i, cst); VEC_replace (tree, *known_binfos_ptr, i, cst);
} }
else if (inline_p else if (inline_p
...@@ -763,20 +763,16 @@ evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p, ...@@ -763,20 +763,16 @@ evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p,
i)->change_prob) i)->change_prob)
VEC_replace (tree, known_vals, i, error_mark_node); VEC_replace (tree, known_vals, i, error_mark_node);
} }
if (clause_ptr && info->conds)
*clause_ptr = evaluate_conditions_for_known_args (callee, inline_p,
known_vals);
if (known_vals_ptr)
*known_vals_ptr = known_vals;
else
VEC_free (tree, heap, known_vals);
} }
if (clause_ptr && !info->conds) if (clause_ptr)
for (i = 0; i < (int)VEC_length (condition, info->conds); i++) *clause_ptr = evaluate_conditions_for_known_args (callee, inline_p,
*clause_ptr |= 1 << (i + predicate_first_dynamic_condition); known_vals);
if (known_vals_ptr)
*known_vals_ptr = known_vals;
else
VEC_free (tree, heap, known_vals);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment