[committed] Fix up libgomp.c/collapse-1.c testcase

Jakub Jelinek jakub@redhat.com
Sat Dec 27 15:32:00 GMT 2008


Hi!

As pointed out by Eric Duncan, collapse-1.c testcase had possible data races,
as in the second collapsed loop k isn't private and only 2 loops are
collapsed, not 3.
Fixed thusly, committed to trunk.

2008-12-27  Jakub Jelinek  <jakub@redhat.com>

	* testsuite/libgomp.c/collapse-1.c (main): Add private(k) clause.

--- libgomp/testsuite/libgomp.c/collapse-1.c.jj	2008-09-05 12:53:58.000000000 +0200
+++ libgomp/testsuite/libgomp.c/collapse-1.c	2008-12-27 12:55:47.000000000 +0100
@@ -17,7 +17,7 @@ main (void)
 	  a[i][j][k] = i + j * 4 + k * 16;
   #pragma omp parallel
     {
-      #pragma omp for collapse(2) reduction(|:l)
+      #pragma omp for collapse(2) reduction(|:l) private(k)
 	for (i = 0; i < 2; i++)
 	  for (j = 0; j < 2; j++)
 	    for (k = 0; k < 2; k++)

	Jakub



More information about the Gcc-patches mailing list