+2015-08-24 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/65468
+ * omp-low.c (expand_omp_for_static_chunk): Remove inner loop if
+ chunk_size is one.
+
2015-08-24 Nathan Sidwell <nathan@acm.org>
* config/nvptx/nvptx.c (walk_args_for_param): Revert previous
assign_stmt = gimple_build_assign (vback, t);
gsi_insert_before (&gsi, assign_stmt, GSI_SAME_STMT);
- t = build2 (fd->loop.cond_code, boolean_type_node,
- DECL_P (vback) && TREE_ADDRESSABLE (vback)
- ? t : vback, e);
+ if (tree_int_cst_equal (fd->chunk_size, integer_one_node))
+ t = build2 (EQ_EXPR, boolean_type_node,
+ build_int_cst (itype, 0),
+ build_int_cst (itype, 1));
+ else
+ t = build2 (fd->loop.cond_code, boolean_type_node,
+ DECL_P (vback) && TREE_ADDRESSABLE (vback)
+ ? t : vback, e);
gsi_insert_before (&gsi, gimple_build_cond_empty (t), GSI_SAME_STMT);
}
+2015-08-24 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/65468
+ * gcc.dg/gomp/static-chunk-size-one.c: New test.
+
2015-08-23 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR libfortran/54572
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -O2 -fdump-tree-optimized -fno-tree-pre" } */
+
+int
+bar ()
+{
+ int a = 0, i;
+
+#pragma omp parallel for num_threads (3) reduction (+:a) schedule(static, 1)
+ for (i = 0; i < 10; i++)
+ a += i;
+
+ return a;
+}
+
+/* Two phis for reduction, one in loop header, one in loop exit. One phi for iv
+ in loop header. */
+/* { dg-final { scan-tree-dump-times "PHI" 3 "optimized" } } */
+2015-08-24 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/65468
+ * testsuite/libgomp.c/static-chunk-size-one.c: New test.
+
2015-08-24 Joost VandeVondele <vondele@gnu.gcc.org>
PR libgomp/66761
--- /dev/null
+extern void abort ();
+
+int
+bar ()
+{
+ int a = 0, i;
+
+#pragma omp parallel for num_threads (3) reduction (+:a) schedule(static, 1)
+ for (i = 0; i < 10; i++)
+ a += i;
+
+ return a;
+}
+
+int
+main (void)
+{
+ int res;
+ res = bar ();
+ if (res != 45)
+ abort ();
+ return 0;
+}