+2020-01-14 Martin Jambor <mjambor@suse.cz>
+
+ Backport from mainline
+ 2020-01-13 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/93223
+ * ipa-cp.c (devirtualization_time_bonus): Check whether isummary is
+ NULL.
+
2020-01-10 Martin Jambor <mjambor@suse.cz>
Backport from mainline
if (avail < AVAIL_AVAILABLE)
continue;
isummary = ipa_fn_summaries->get (callee);
- if (!isummary->inlinable)
+ if (!isummary || !isummary->inlinable)
continue;
/* FIXME: The values below need re-considering and perhaps also
+2020-01-14 Martin Jambor <mjambor@suse.cz>
+
+ Backport from mainline
+ 2020-01-13 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/93223
+ * g++.dg/ipa/pr93223.C: New test.
+
2020-01-13 Joseph Myers <joseph@codesourcery.com>
Backport from mainline:
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3 -std=gnu++14" } */
+
+template <typename Function>
+bool run(const int item_count,
+ Function && process_range,
+ const int max_parallelism,
+ int* progress = nullptr)
+{
+ if (max_parallelism <= 1)
+ {
+ if (progress == nullptr)
+ {
+ return process_range(0);
+ }
+ else
+ {
+ auto result = true;
+ for (int i = 0; i != item_count && result; ++i)
+ {
+ (*progress)++;
+ result = process_range(i);
+ }
+ return result;
+ }
+ }
+
+ if (max_parallelism > 10)
+ {
+ if (progress == nullptr)
+ {
+ return process_range(0);
+ }
+ else
+ {
+ auto result = true;
+ for (int i = 0; i != item_count && result; ++i)
+ {
+ (*progress)++;
+ result = process_range(i);
+ }
+ return result;
+ }
+ }
+ return false;
+}
+
+namespace
+{
+__attribute__((optimize(0))) bool worker_fun(const int)
+{
+ return true;
+}
+}
+
+void demo(int n)
+{
+ for (int i = 0; i < n; ++i)
+ {
+ run(n, &worker_fun, n);
+ }
+}