Commit 6f9549ee by Martin Jambor Committed by Martin Jambor

re PR ipa/61986 (ICE on valid code at -O3 on x86_64-linux-gnu…

re PR ipa/61986 (ICE on valid code at -O3 on x86_64-linux-gnu indecide_about_value, at ipa-cp.c:3480)

2014-09-03  Martin Jambor  <mjambor@suse.cz>
    
	PR ipa/61986
	* ipa-cp.c (find_aggregate_values_for_callers_subset): Chain
	created replacements in ascending order of offsets.
	(known_aggs_to_agg_replacement_list): Likewise.
    
gcc/testsuite/
	* gcc.dg/ipa/pr61986.c: New test.

From-SVN: r214877
parent 2b3ae5d1
2014-09-03 Martin Jambor <mjambor@suse.cz>
PR ipa/61986
* ipa-cp.c (find_aggregate_values_for_callers_subset): Chain
created replacements in ascending order of offsets.
(known_aggs_to_agg_replacement_list): Likewise.
2014-09-03 Martin Liska <mliska@suse.cz> 2014-09-03 Martin Liska <mliska@suse.cz>
* tree-ssa-sccvn.c (vn_reference_lookup_call): default (NULL) value * tree-ssa-sccvn.c (vn_reference_lookup_call): default (NULL) value
...@@ -3146,7 +3146,8 @@ find_aggregate_values_for_callers_subset (struct cgraph_node *node, ...@@ -3146,7 +3146,8 @@ find_aggregate_values_for_callers_subset (struct cgraph_node *node,
vec<cgraph_edge *> callers) vec<cgraph_edge *> callers)
{ {
struct ipa_node_params *dest_info = IPA_NODE_REF (node); struct ipa_node_params *dest_info = IPA_NODE_REF (node);
struct ipa_agg_replacement_value *res = NULL; struct ipa_agg_replacement_value *res;
struct ipa_agg_replacement_value **tail = &res;
struct cgraph_edge *cs; struct cgraph_edge *cs;
int i, j, count = ipa_get_param_count (dest_info); int i, j, count = ipa_get_param_count (dest_info);
...@@ -3190,14 +3191,15 @@ find_aggregate_values_for_callers_subset (struct cgraph_node *node, ...@@ -3190,14 +3191,15 @@ find_aggregate_values_for_callers_subset (struct cgraph_node *node,
v->offset = item->offset; v->offset = item->offset;
v->value = item->value; v->value = item->value;
v->by_ref = plats->aggs_by_ref; v->by_ref = plats->aggs_by_ref;
v->next = res; *tail = v;
res = v; tail = &v->next;
} }
next_param: next_param:
if (inter.exists ()) if (inter.exists ())
inter.release (); inter.release ();
} }
*tail = NULL;
return res; return res;
} }
...@@ -3206,7 +3208,8 @@ find_aggregate_values_for_callers_subset (struct cgraph_node *node, ...@@ -3206,7 +3208,8 @@ find_aggregate_values_for_callers_subset (struct cgraph_node *node,
static struct ipa_agg_replacement_value * static struct ipa_agg_replacement_value *
known_aggs_to_agg_replacement_list (vec<ipa_agg_jump_function> known_aggs) known_aggs_to_agg_replacement_list (vec<ipa_agg_jump_function> known_aggs)
{ {
struct ipa_agg_replacement_value *res = NULL; struct ipa_agg_replacement_value *res;
struct ipa_agg_replacement_value **tail = &res;
struct ipa_agg_jump_function *aggjf; struct ipa_agg_jump_function *aggjf;
struct ipa_agg_jf_item *item; struct ipa_agg_jf_item *item;
int i, j; int i, j;
...@@ -3220,9 +3223,10 @@ known_aggs_to_agg_replacement_list (vec<ipa_agg_jump_function> known_aggs) ...@@ -3220,9 +3223,10 @@ known_aggs_to_agg_replacement_list (vec<ipa_agg_jump_function> known_aggs)
v->offset = item->offset; v->offset = item->offset;
v->value = item->value; v->value = item->value;
v->by_ref = aggjf->by_ref; v->by_ref = aggjf->by_ref;
v->next = res; *tail = v;
res = v; tail = &v->next;
} }
*tail = NULL;
return res; return res;
} }
......
2014-09-03 Martin Jambor <mjambor@suse.cz>
PR ipa/61986
* gcc.dg/ipa/pr61986.c: New test.
2014-09-03 Marek Polacek <polacek@redhat.com> 2014-09-03 Marek Polacek <polacek@redhat.com>
PR c/62294 PR c/62294
......
/* { dg-do compile } */
/* { dg-options "-O3" } */
int a, b, c;
struct S
{
int f0;
int f1;
} d;
static int fn2 (struct S);
void fn3 (struct S);
void
fn1 (struct S p)
{
struct S h = { 0, 0 };
fn3 (p);
fn2 (h);
}
int
fn2 (struct S p)
{
struct S j = { 0, 0 };
fn3 (p);
fn2 (j);
return 0;
}
void
fn3 (struct S p)
{
for (; b; a++)
c = p.f0;
fn1 (d);
}
void
fn4 ()
{
for (;;)
{
struct S f = { 0, 0 };
fn1 (f);
}
}
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