+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>
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)
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;
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>
--- /dev/null
+/* { 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" } } */