Commit 03360965 by Martin Jambor Committed by Martin Jambor

re PR middle-end/54409 (internal compiler error: in remap_predicate, at ipa-inline-analysis.c:2710)

2012-08-31  Martin Jambor  <mjambor@suse.cz>

	PR middle-end/54409
	* ipa-inline-analysis.c (remap_predicate): Fix the offset_map
	checking condition.

	* gcc/testsuite/gcc.dg/torture/pr54409.c: New test.

From-SVN: r190833
parent 48679f6e
2012-08-31 Martin Jambor <mjambor@suse.cz> 2012-08-31 Martin Jambor <mjambor@suse.cz>
PR middle-end/54409
* ipa-inline-analysis.c (remap_predicate): Fix the offset_map
checking condition.
2012-08-31 Martin Jambor <mjambor@suse.cz>
* ipa-inline-analysis.c (phi_result_unknown_predicate): New function. * ipa-inline-analysis.c (phi_result_unknown_predicate): New function.
(predicate_for_phi_result): Likewise. (predicate_for_phi_result): Likewise.
(estimate_function_body_sizes): Use the above two functions. (estimate_function_body_sizes): Use the above two functions.
......
...@@ -2811,8 +2811,11 @@ remap_predicate (struct inline_summary *info, ...@@ -2811,8 +2811,11 @@ remap_predicate (struct inline_summary *info,
if (!operand_map if (!operand_map
|| (int)VEC_length (int, operand_map) <= c->operand_num || (int)VEC_length (int, operand_map) <= c->operand_num
|| VEC_index (int, operand_map, c->operand_num) == -1 || VEC_index (int, operand_map, c->operand_num) == -1
|| (!c->agg_contents /* TODO: For non-aggregate conditions, adding an offset is
&& VEC_index (int, offset_map, c->operand_num) != 0) basically an arithmetic jump function processing which
we should support in future. */
|| ((!c->agg_contents || !c->by_ref)
&& VEC_index (int, offset_map, c->operand_num) > 0)
|| (c->agg_contents && c->by_ref || (c->agg_contents && c->by_ref
&& VEC_index (int, offset_map, c->operand_num) < 0)) && VEC_index (int, offset_map, c->operand_num) < 0))
cond_predicate = true_predicate (); cond_predicate = true_predicate ();
......
2012-08-31 Martin Jambor <mjambor@suse.cz> 2012-08-31 Martin Jambor <mjambor@suse.cz>
PR middle-end/54409
* gcc.dg/torture/pr54409.c: New test.
2012-08-31 Martin Jambor <mjambor@suse.cz>
* gfortran.dg/pr48636.f90: Add dump scan checks. * gfortran.dg/pr48636.f90: Add dump scan checks.
2012-08-29 Richard Sandiford <rdsandiford@googlemail.com> 2012-08-29 Richard Sandiford <rdsandiford@googlemail.com>
......
/* { dg-do compile } */
int b;
struct S
{
char *p;
struct {
} s;
int a;
};
static _Bool
fn2 (int *p1)
{
if (b)
{
struct S *c = (struct S *) &p1;
return c->a;
}
}
_Bool
fn3 (struct S *p1)
{
if (fn2 ((int *) &p1->s))
return 0;
}
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