]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
taskloop-reduction-3.c (bar): Define iterator inside of the construct.
authorJakub Jelinek <jakub@redhat.com>
Thu, 18 Oct 2018 18:42:27 +0000 (20:42 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 18 Oct 2018 18:42:27 +0000 (20:42 +0200)
* testsuite/libgomp.c-c++-common/taskloop-reduction-3.c (bar): Define
iterator inside of the construct.

From-SVN: r265281

libgomp/ChangeLog.gomp
libgomp/testsuite/libgomp.c-c++-common/taskloop-reduction-3.c

index a58fc2cbf987917c741cdd68b3131986cfc097c1..2810c05640a0e0796fb9cb707605fcce2c8b8325 100644 (file)
@@ -1,5 +1,8 @@
 2018-10-18  Jakub Jelinek  <jakub@redhat.com>
 
+       * testsuite/libgomp.c-c++-common/taskloop-reduction-3.c (bar): Define
+       iterator inside of the construct.
+
        * testsuite/libgomp.c-c++-common/master-combined-1.c: New test.
        * testsuite/libgomp.c-c++-common/taskloop-reduction-3.c: New test.
        * testsuite/libgomp.c-c++-common/taskloop-reduction-4.c: New test.
index 5a1c154ddd639b730d5048fbe0b11aa4eb5b1415..30a832490465eaf3f941512d1ac72fbf394fad47 100644 (file)
@@ -19,9 +19,8 @@ foo (void)
 __attribute__((noipa)) void
 bar (int x)
 {
-  int i;
   #pragma omp taskloop simd in_reduction (+:n) grainsize (64) nogroup
-  for (i = (x & 1) * (N / 2); i < (x & 1) * (N / 2) + (N / 2); i++)
+  for (int i = (x & 1) * (N / 2); i < (x & 1) * (N / 2) + (N / 2); i++)
     n += 2 * u[i];
 }