gcc_assert (!jfunc->agg.items);
ret |= merge_aggregate_lattices (cs, dest_plats, src_plats,
src_idx, 0);
+ return ret;
}
- else
- ret |= set_agg_lats_contain_variable (dest_plats);
}
else if (jfunc->type == IPA_JF_ANCESTOR
&& ipa_get_jf_ancestor_agg_preserved (jfunc))
ret |= set_agg_lats_to_bottom (dest_plats);
else
ret |= set_agg_lats_contain_variable (dest_plats);
+ return ret;
}
- else if (jfunc->agg.items)
+
+ if (jfunc->agg.items)
{
bool pre_existing = dest_plats->aggs != NULL;
struct ipcp_agg_lattice **aglat = &dest_plats->aggs;
else
intersect_with_agg_replacements (cs->caller, src_idx,
&inter, 0);
- }
- else
- {
- inter.release ();
- return vNULL;
+ return inter;
}
}
else
inter = copy_plats_to_inter (src_plats, 0);
else
intersect_with_plats (src_plats, &inter, 0);
- }
- else
- {
- inter.release ();
- return vNULL;
+ return inter;
}
}
}
else
intersect_with_plats (src_plats, &inter, delta);
}
+ return inter;
}
- else if (jfunc->agg.items)
+
+ if (jfunc->agg.items)
{
class ipa_node_params *caller_info = IPA_NODE_REF (cs->caller);
struct ipa_agg_value *item;
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-ipa-sra -fdump-ipa-cp --param ipa-cp-eval-threshold=1" } */
+
+int data;
+int fn();
+
+int __attribute__((noinline)) f1 (int *p)
+{
+ data = *p;
+ fn ();
+ return 0;
+}
+
+int __attribute__((noinline)) f2 (int *p)
+{
+ *p = *p + 1;
+ f1 (p);
+ return 1;
+}
+
+int __attribute__((noinline)) f3 (int a, int *p)
+{
+ *p = a - 2;
+ f1 (p);
+ return 1;
+}
+
+int f4 ()
+{
+ int i;
+
+ for (i = 0; i < 100; i++)
+ {
+ int v = 2;
+
+ f2 (&v);
+ f3 (6, &v);
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump "Aggregate replacements: 0\\\[0]=2" "cp" } } */
+/* { dg-final { scan-ipa-dump "Aggregate replacements: 0\\\[0]=3" "cp" } } */
+/* { dg-final { scan-ipa-dump "Aggregate replacements: 0\\\[0]=4" "cp" } } */
/* { dg-do compile } */
-/* { dg-options "-O3 -fno-ipa-sra -fdump-tree-optimized-slim" } */
+/* { dg-options "-O3 -fno-ipa-sra -fdump-ipa-cp" } */
/* { dg-add-options bind_pic_locally } */
struct S
foo (4, i, &s);
}
}
-/* { dg-final { scan-tree-dump "->b;" "optimized" } } */
+/* { dg-final { scan-ipa-dump "Aggregate replacements: 1\\\[32]=64, 1\\\[64]=32" "cp" } } */
+/* { dg-final { scan-ipa-dump "Aggregate replacements: 1\\\[32]=0" "cp" } } */