Commit 8bda7ce8 by Martin Jambor Committed by Martin Jambor

IPA-CP: Remove bogus static keyword (PR 92971)

2019-12-18  Martin Jambor  <mjambor@suse.cz>

	PR ipa/92971
	* ipa-cp.c (cgraph_edge_brings_all_agg_vals_for_node): Fix
          definition of values, release memory on exit.

	testsuite/
	* gcc.dg/ipa/ipcp-agg-12.c: New test.

From-SVN: r279525
parent 15ef0544
2019-12-18 Martin Jambor <mjambor@suse.cz>
PR ipa/92971
* ipa-cp.c (cgraph_edge_brings_all_agg_vals_for_node): Fix
definition of values, release memory on exit.
2019-12-17 Jan Hubicka <hubicka@ucw.cz>
Martin Jambor <mjambor@suse.cz>
......@@ -5117,7 +5117,6 @@ cgraph_edge_brings_all_agg_vals_for_node (struct cgraph_edge *cs,
for (i = 0; i < count; i++)
{
static vec<ipa_agg_value> values = vNULL;
class ipcp_param_lattices *plats;
bool interesting = false;
for (struct ipa_agg_replacement_value *av = aggval; av; av = av->next)
......@@ -5133,7 +5132,7 @@ cgraph_edge_brings_all_agg_vals_for_node (struct cgraph_edge *cs,
if (plats->aggs_bottom)
return false;
values = intersect_aggregates_with_edge (cs, i, values);
vec<ipa_agg_value> values = intersect_aggregates_with_edge (cs, i, vNULL);
if (!values.exists ())
return false;
......@@ -5157,6 +5156,7 @@ cgraph_edge_brings_all_agg_vals_for_node (struct cgraph_edge *cs,
return false;
}
}
values.release ();
}
return true;
}
......
2019-12-18 Martin Jambor <mjambor@suse.cz>
PR ipa/92971
* gcc.dg/ipa/ipcp-agg-12.c: New test.
2019-12-17 Jan Hubicka <hubicka@ucw.cz>
Martin Jambor <mjambor@suse.cz>
......
/* { dg-do compile } */
/* { dg-options "-O3 -fno-ipa-sra -fdump-ipa-cp-details --param=ipa-cp-eval-threshold=2" } */
struct S
{
int a, b, c;
};
int __attribute__((noinline)) foo (int i, struct S s);
int __attribute__((noinline)) bar (int i, struct S s);
int __attribute__((noinline)) baz (int i, struct S s);
int __attribute__((noinline))
bar (int i, struct S s)
{
return baz (i, s);
}
int __attribute__((noinline))
baz (int i, struct S s)
{
return foo (i, s);
}
int __attribute__((noinline))
foo (int i, struct S s)
{
if (i == 2)
return 0;
else
return s.b * s.b + bar (i - 1, s);
}
volatile int g;
void entry (void)
{
struct S s;
s.b = 4;
g = bar (g, s);
}
void entry2 (void)
{
struct S s;
s.b = 6;
g = baz (g, s);
}
/* { dg-final { scan-ipa-dump-times "adding an extra caller" 2 "cp" } } */
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