PR rtl-optimization/84872
* cfgloopmanip.c (create_preheader): Use make_forwarder_block even if
nentry == 1 when CP_FALLTHRU_PREHEADERS and single_entry is
EDGE_CROSSING edge.
* gcc.dg/graphite/pr84872.c: New test.
From-SVN: r259182
+2018-04-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/84872
+ * cfgloopmanip.c (create_preheader): Use make_forwarder_block even if
+ nentry == 1 when CP_FALLTHRU_PREHEADERS and single_entry is
+ EDGE_CROSSING edge.
+
2018-04-06 Tamar Christina <tamar.christina@arm.com>
* expr.c (copy_blkmode_to_reg): Revert 254862.
mfb_kj_edge = loop_latch_edge (loop);
latch_edge_was_fallthru = (mfb_kj_edge->flags & EDGE_FALLTHRU) != 0;
- if (nentry == 1)
+ if (nentry == 1
+ && ((flags & CP_FALLTHRU_PREHEADERS) == 0
+ || (single_entry->flags & EDGE_CROSSING) == 0))
dummy = split_edge (single_entry);
else
{
2018-04-06 Jakub Jelinek <jakub@redhat.com>
+ PR rtl-optimization/84872
+ * gcc.dg/graphite/pr84872.c: New test.
+
PR c++/85210
* g++.dg/cpp1z/decomp42.C: New test.
--- /dev/null
+/* PR rtl-optimization/84872 */
+/* { dg-do compile { target pthread } } */
+/* { dg-options "-O1 -floop-parallelize-all -freorder-blocks-and-partition -fschedule-insns2 -fselective-scheduling2 -fsel-sched-pipelining -fno-tree-dce" } */
+
+void
+foo (int x)
+{
+ int a[2];
+ int b, c = 0;
+
+ for (b = 0; b < 2; ++b)
+ a[b] = 0;
+ for (b = 0; b < 2; ++b)
+ a[b] = 0;
+
+ while (c < 1)
+ while (x < 1)
+ ++x;
+}