2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-03-21 10:30:34 +08:00

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
This commit is contained in:
Jan Hubicka 2011-06-04 20:00:47 +02:00 committed by Jan Hubicka
parent 6c6424b3d7
commit a45c055721
4 changed files with 35 additions and 1 deletions

@ -1,3 +1,11 @@
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

@ -555,9 +555,17 @@ evaluate_conditions_for_known_args (struct cgraph_node *node,
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;
/* 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)
{
clause |= 1 << (i + predicate_first_dynamic_condition);

@ -1,3 +1,10 @@
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

@ -0,0 +1,11 @@
! { 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