summaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2015-07-28 07:54:04 +0000
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2015-07-28 07:54:04 +0000
commit95f4166a16df1e8259e2465dc238f9e864806c15 (patch)
treec8e721d99e98b1d94dbde05660f4bbdccf11aa88 /libgomp
parent16db63950c10c3c175811bdcf7dc4c6785dbc294 (diff)
downloadgcc-95f4166a16df1e8259e2465dc238f9e864806c15.tar.gz
Handle double reduction in parloops
2015-07-28 Tom de Vries <tom@codesourcery.com> * tree-parloops.c (reduc_stmt_res): New function. (initialize_reductions, add_field_for_reduction) (create_phi_for_local_result, create_loads_for_reductions) (create_stores_for_reduction, build_new_reduction): Handle case that reduc_stmt is a phi. (gather_scalar_reductions): Allow double_reduc reductions. * gcc.dg/autopar/uns-outer-4.c: Remove xfail on scan for parallelizing outer loop. * testsuite/libgomp.c/uns-outer-4.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226300 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog4
-rw-r--r--libgomp/testsuite/libgomp.c/uns-outer-4.c36
2 files changed, 40 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index d2189928577..4c9f690a8e7 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,7 @@
+2015-07-28 Tom de Vries <tom@codesourcery.com>
+
+ * testsuite/libgomp.c/uns-outer-4.c: New test.
+
2015-07-24 Cesar Philippidis <cesar@codesourcery.com>
* testsuite/libgomp.c/pr66714.c: New test.
diff --git a/libgomp/testsuite/libgomp.c/uns-outer-4.c b/libgomp/testsuite/libgomp.c/uns-outer-4.c
new file mode 100644
index 00000000000..cd646a54133
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/uns-outer-4.c
@@ -0,0 +1,36 @@
+/* { dg-do run } */
+/* { dg-additional-options "-ftree-parallelize-loops=2" } */
+
+void abort (void);
+
+unsigned int g_sum = 1;
+
+unsigned int x[500][500];
+
+void __attribute__((noinline,noclone))
+parloop (int N)
+{
+ int i, j;
+ unsigned int sum;
+
+ /* Double reduction is detected, outer loop is parallelized. */
+ sum = 0;
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ sum += x[i][j];
+
+ g_sum = sum;
+}
+
+int
+main (void)
+{
+ x[234][432] = 2;
+
+ parloop (500);
+
+ if (g_sum != 2)
+ abort ();
+
+ return 0;
+}