Commit a45c0557 by Jan Hubicka Committed by Jan Hubicka

re PR middle-end/48893 (ICE in evaulate_conditions_for_edge at ipa-inline-analysis.c:477)

	PR tree-optimization/48893
	PR tree-optimization/49091
	PR tree-optimization/49179
	* ipa-inline-analysis.c (evaluate_conditions_for_known_args):
	Bounds check.

	* gfortran.dg/pr49179.f90: New testcase

From-SVN: r174648
parent 6c6424b3
2011-06-04 Jan Hubicka <jh@suse.cz> 2011-06-04 Jan Hubicka <jh@suse.cz>
PR tree-optimization/48893
PR tree-optimization/49091
PR tree-optimization/49179
* ipa-inline-analysis.c (evaluate_conditions_for_known_args):
Bounds check.
2011-06-04 Jan Hubicka <jh@suse.cz>
PR lto/48954 PR lto/48954
* lto-cgraph.c (output_node_opt_summary): Handle NULL skip args bitmaps. * lto-cgraph.c (output_node_opt_summary): Handle NULL skip args bitmaps.
......
...@@ -555,9 +555,17 @@ evaluate_conditions_for_known_args (struct cgraph_node *node, ...@@ -555,9 +555,17 @@ evaluate_conditions_for_known_args (struct cgraph_node *node,
for (i = 0; VEC_iterate (condition, info->conds, i, c); i++) for (i = 0; VEC_iterate (condition, info->conds, i, c); i++)
{ {
tree val = VEC_index (tree, known_vals, c->operand_num); tree val;
tree res; tree res;
/* We allow call stmt to have fewer arguments than the callee
function (especially for K&R style programs). So bound
check here. */
if (c->operand_num < (int)VEC_length (tree, known_vals))
val = VEC_index (tree, known_vals, c->operand_num);
else
val = NULL;
if (!val) if (!val)
{ {
clause |= 1 << (i + predicate_first_dynamic_condition); clause |= 1 << (i + predicate_first_dynamic_condition);
......
2011-06-04 Jan Hubicka <jh@suse.cz> 2011-06-04 Jan Hubicka <jh@suse.cz>
PR tree-optimization/48893
PR tree-optimization/49091
PR tree-optimization/49179
* gfortran.dg/pr49179.f90: New testcase
2011-06-04 Jan Hubicka <jh@suse.cz>
PR lto/48954 PR lto/48954
* g++.dg/torture/pr48954.C: New testcase. * g++.dg/torture/pr48954.C: New testcase.
......
! { dg-options " -O -findirect-inlining" }
function more_OK (fcn)
character(*) more_OK
character (*), external :: fcn
more_OK = fcn ()
end function more_OK
character(4) :: answer
character(4), external :: is_OK, more_OK
answer = more_OK (is_OK)
contains
END
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