re PR testsuite/34821 (new gcc.dg testsuite failures)
authorSebastian Pop <sebastian.pop@amd.com>
Thu, 17 Jan 2008 17:54:56 +0000 (17:54 +0000)
committerSebastian Pop <spop@gcc.gnu.org>
Thu, 17 Jan 2008 17:54:56 +0000 (17:54 +0000)
2008-01-17  Sebastian Pop  <sebastian.pop@amd.com>

PR testsuite/34821
* gcc.dg/autopar/autopar.exp: New.
* g++.dg/tree-ssa/pr34355.C: Require pthread.
* lib/target-supports.exp (check_effective_target_pthread): New.

* gcc.dg/tree-ssa/parallelization-1.c: Moved to gcc.dg/autopar.
* gcc.dg/tree-ssa/reduc-1short.c: Same.
* gcc.dg/tree-ssa/reduc-1.c: Same.
* gcc.dg/tree-ssa/reduc-2short.c: Same.
* gcc.dg/tree-ssa/reduc-2.c: Same
* gcc.dg/tree-ssa/reduc-3.c: Same.
* gcc.dg/tree-ssa/reduc-1char.c: Same.
* gcc.dg/tree-ssa/reduc-6.c: Same.
* gcc.dg/tree-ssa/reduc-7.c: Same.
* gcc.dg/tree-ssa/reduc-2char.c: Same.
* gcc.dg/tree-ssa/reduc-8.c: Same.
* gcc.dg/tree-ssa/reduc-9.c: Same.

From-SVN: r131605

28 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr34355.C
gcc/testsuite/gcc.dg/autopar/autopar.exp [new file with mode: 0644]
gcc/testsuite/gcc.dg/autopar/parallelization-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/autopar/reduc-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/autopar/reduc-1char.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/autopar/reduc-1short.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/autopar/reduc-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/autopar/reduc-2char.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/autopar/reduc-2short.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/autopar/reduc-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/autopar/reduc-6.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/autopar/reduc-7.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/autopar/reduc-8.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/autopar/reduc-9.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/parallelization-1.c [deleted file]
gcc/testsuite/gcc.dg/tree-ssa/reduc-1.c [deleted file]
gcc/testsuite/gcc.dg/tree-ssa/reduc-1char.c [deleted file]
gcc/testsuite/gcc.dg/tree-ssa/reduc-1short.c [deleted file]
gcc/testsuite/gcc.dg/tree-ssa/reduc-2.c [deleted file]
gcc/testsuite/gcc.dg/tree-ssa/reduc-2char.c [deleted file]
gcc/testsuite/gcc.dg/tree-ssa/reduc-2short.c [deleted file]
gcc/testsuite/gcc.dg/tree-ssa/reduc-3.c [deleted file]
gcc/testsuite/gcc.dg/tree-ssa/reduc-6.c [deleted file]
gcc/testsuite/gcc.dg/tree-ssa/reduc-7.c [deleted file]
gcc/testsuite/gcc.dg/tree-ssa/reduc-8.c [deleted file]
gcc/testsuite/gcc.dg/tree-ssa/reduc-9.c [deleted file]
gcc/testsuite/lib/target-supports.exp

index b5a41620f9effe7663ef50f4f7333eacd8e7b16c..3a460685243b8de44a5cf663510aacba00a8aa90 100644 (file)
@@ -1,3 +1,23 @@
+2008-01-17  Sebastian Pop  <sebastian.pop@amd.com>
+
+       PR testsuite/34821
+       * gcc.dg/autopar/autopar.exp: New.
+       * g++.dg/tree-ssa/pr34355.C: Require pthread.
+       * lib/target-supports.exp (check_effective_target_pthread): New.
+
+       * gcc.dg/tree-ssa/parallelization-1.c: Moved to gcc.dg/autopar.
+       * gcc.dg/tree-ssa/reduc-1short.c: Same.
+       * gcc.dg/tree-ssa/reduc-1.c: Same.
+       * gcc.dg/tree-ssa/reduc-2short.c: Same.
+       * gcc.dg/tree-ssa/reduc-2.c: Same
+       * gcc.dg/tree-ssa/reduc-3.c: Same.
+       * gcc.dg/tree-ssa/reduc-1char.c: Same.
+       * gcc.dg/tree-ssa/reduc-6.c: Same.
+       * gcc.dg/tree-ssa/reduc-7.c: Same.
+       * gcc.dg/tree-ssa/reduc-2char.c: Same.
+       * gcc.dg/tree-ssa/reduc-8.c: Same.
+       * gcc.dg/tree-ssa/reduc-9.c: Same.
+
 2008-01-17  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/discr5.adb: New test.
index 212c54777445b508f363a481b3036fd260c25326..414a93746376d587441e4c1576290c85ff7f184c 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-require-effective-target pthread } 
 // { dg-do compile }
 // { dg-options "-O3 -ftree-parallelize-loops=4" }
 
diff --git a/gcc/testsuite/gcc.dg/autopar/autopar.exp b/gcc/testsuite/gcc.dg/autopar/autopar.exp
new file mode 100644 (file)
index 0000000..d19e51f
--- /dev/null
@@ -0,0 +1,40 @@
+#   Copyright (C) 2008 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+if ![check_effective_target_pthread] {
+  return
+}
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+    set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
+       "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.dg/autopar/parallelization-1.c b/gcc/testsuite/gcc.dg/autopar/parallelization-1.c
new file mode 100644 (file)
index 0000000..ee62ff6
--- /dev/null
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
+
+void abort (void);
+
+void parloop (int N)
+{
+  int i;
+  int x[10000000];
+
+  for (i = 0; i < N; i++)
+    x[i] = i + 3;
+
+  for (i = 0; i < N; i++)
+    {
+      if (x[i] != i + 3)
+       abort ();
+    }
+}
+
+int main(void)
+{
+  parloop(10000000);
+
+  return 0;
+}
+
+/* Check that the first loop in parloop got parallelized.  */
+
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 5 "final_cleanup" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-1.c b/gcc/testsuite/gcc.dg/autopar/reduc-1.c
new file mode 100644 (file)
index 0000000..c7f53e1
--- /dev/null
@@ -0,0 +1,57 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+
+#define N 16
+#define DIFF 242
+
+/* Reduction of unsigned-int.  */
+
+void main1 (unsigned int x, unsigned int max_result, unsigned int min_result)
+{
+  int i;
+  unsigned int ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+  unsigned int uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+  unsigned int udiff = 2;
+  unsigned int umax = x;
+  unsigned int umin = x;
+
+  /* Summation.  */
+  for (i = 0; i < N; i++) {
+    udiff += (ub[i] - uc[i]);
+  }
+
+  /* Maximum.  */
+  for (i = 0; i < N; i++) {
+    umax = umax < uc[i] ? uc[i] : umax;
+  }
+
+  /* Minimum.  */
+  for (i = 0; i < N; i++) {
+    umin = umin > uc[i] ? uc[i] : umin;
+  }
+
+  /* check results:  */
+  if (udiff != DIFF)
+    abort ();
+  if (umax != max_result)
+    abort ();
+  if (umin != min_result)
+    abort ();
+}
+
+int main (void)
+{ 
+  
+  main1 (100, 100, 1);
+  main1 (0, 15, 0);
+  return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 3 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
+
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-1char.c b/gcc/testsuite/gcc.dg/autopar/reduc-1char.c
new file mode 100644 (file)
index 0000000..87f758a
--- /dev/null
@@ -0,0 +1,52 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+
+#define N 16
+#define DIFF 242
+
+__attribute__ ((noinline)) void
+main1 (unsigned char x, unsigned char max_result, unsigned char min_result)
+{
+  int i;
+  unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+  unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+  unsigned char udiff = 2;
+  unsigned char umax = x;
+  unsigned char umin = x;
+
+  for (i = 0; i < N; i++) {
+    udiff += (unsigned char)(ub[i] - uc[i]);
+  }
+
+  for (i = 0; i < N; i++) {
+    umax = umax < uc[i] ? uc[i] : umax;
+  }
+
+  for (i = 0; i < N; i++) {
+    umin = umin > uc[i] ? uc[i] : umin;
+  }
+
+  /* check results:  */
+  if (udiff != DIFF)
+    abort ();
+  if (umax != max_result)
+    abort ();
+  if (umin != min_result)
+    abort ();
+}
+
+int main (void)
+{ 
+  main1 (100, 100, 1);
+  main1 (0, 15, 0);
+  return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 3 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
+
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-1short.c b/gcc/testsuite/gcc.dg/autopar/reduc-1short.c
new file mode 100644 (file)
index 0000000..75d0954
--- /dev/null
@@ -0,0 +1,52 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+
+#define N 16
+#define DIFF 242
+
+__attribute__ ((noinline)) void
+main1 (unsigned short x, unsigned short max_result, unsigned short min_result)
+{
+  int i;
+  unsigned short ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+  unsigned short uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+  unsigned short  udiff = 2;
+  unsigned short umax = x;
+  unsigned short umin = x;
+
+  for (i = 0; i < N; i++) {
+    udiff += (unsigned short)(ub[i] - uc[i]);
+  }
+
+  for (i = 0; i < N; i++) {
+    umax = umax < uc[i] ? uc[i] : umax;
+  }
+
+  for (i = 0; i < N; i++) {
+    umin = umin > uc[i] ? uc[i] : umin;
+  }
+
+  /* check results:  */
+  if (udiff != DIFF)
+    abort ();
+  if (umax != max_result)
+    abort ();
+  if (umin != min_result)
+    abort ();
+}
+
+int main (void)
+{ 
+  main1 (100, 100, 1);
+  main1 (0, 15, 0);
+  return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 3 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
+
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-2.c b/gcc/testsuite/gcc.dg/autopar/reduc-2.c
new file mode 100644 (file)
index 0000000..d462f89
--- /dev/null
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+
+#define N 16
+#define DIFF 240
+
+/* Reduction of signed-int.  */
+
+__attribute__ ((noinline))
+void main1 (int x, int max_result, int min_result)
+{
+  int i;
+  int b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+  int c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+  int diff = 0;
+  int max = x;
+  int min = x;
+
+  for (i = 0; i < N; i++) {
+    diff += (b[i] - c[i]);
+  }
+
+  for (i = 0; i < N; i++) {
+    max = max < c[i] ? c[i] : max;
+  }
+
+  for (i = 0; i < N; i++) {
+    min = min > c[i] ? c[i] : min;
+  }
+
+  /* check results:  */
+  if (diff != DIFF)
+    abort ();
+  if (max != max_result)
+    abort ();
+  if (min != min_result)
+    abort ();
+}
+
+int main (void)
+{ 
+  main1 (100, 100, 1);
+  main1 (0, 15, 0);
+  return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 3 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
+
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-2char.c b/gcc/testsuite/gcc.dg/autopar/reduc-2char.c
new file mode 100644 (file)
index 0000000..15acb3b
--- /dev/null
@@ -0,0 +1,53 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+
+#define N 16
+#define DIFF 121
+
+__attribute__ ((noinline))
+void main1 (signed char x, signed char max_result, signed char min_result)
+{
+  int i;
+  signed char b[N] = {1,2,3,6,8,10,12,14,16,18,20,22,24,26,28,30};
+  signed char c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+  signed char diff = 2;
+  signed char max = x;
+  signed char min = x;
+
+  for (i = 0; i < N; i++) {
+    diff += (signed char)(b[i] - c[i]);
+  }
+
+  for (i = 0; i < N; i++) {
+    max = max < c[i] ? c[i] : max;
+  }
+
+  for (i = 0; i < N; i++) {
+    min = min > c[i] ? c[i] : min;
+  }
+
+  /* check results:  */
+  if (diff != DIFF)
+    abort ();
+  if (max != max_result)
+    abort ();
+  if (min != min_result)
+    abort ();
+}
+
+int main (void)
+{ 
+  main1 (100, 100, 1);
+  main1 (0, 15, 0);
+  return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 2 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
+
+
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-2short.c b/gcc/testsuite/gcc.dg/autopar/reduc-2short.c
new file mode 100644 (file)
index 0000000..f98402e
--- /dev/null
@@ -0,0 +1,51 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+
+#define N 16
+#define DIFF 242
+
+__attribute__ ((noinline))
+void main1 (short x, short max_result, short min_result)
+{
+  int i;
+  short b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+  short c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+  short diff = 2;
+  short max = x;
+  short min = x;
+
+  for (i = 0; i < N; i++) {
+    diff += (short)(b[i] - c[i]);
+  }
+  for (i = 0; i < N; i++) {
+    max = max < c[i] ? c[i] : max;
+  }
+
+  for (i = 0; i < N; i++) {
+    min = min > c[i] ? c[i] : min;
+  }
+
+  /* check results:  */
+  if (diff != DIFF)
+    abort ();
+  if (max != max_result)
+    abort ();
+  if (min != min_result)
+    abort ();
+}
+
+int main (void)
+{ 
+  main1 (100, 100, 1);
+  main1 (0, 15, 0);
+  return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 2 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
+
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-3.c b/gcc/testsuite/gcc.dg/autopar/reduc-3.c
new file mode 100644 (file)
index 0000000..31ed2bc
--- /dev/null
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+
+#define N 16
+
+/* Reduction of unsigned-int.  */
+
+__attribute__ ((noinline))
+int main1 (int n, int res)
+{
+  int i;
+  unsigned int ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+  unsigned int uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+  unsigned int udiff;
+
+  udiff = 0;
+  for (i = 0; i < n; i++) {
+    udiff += (ub[i] - uc[i]);
+  }
+
+  /* check results:  */
+  if (udiff != res)
+    abort ();
+
+  return 0;
+}
+
+int main (void)
+{ 
+  main1 (N, 240);
+  main1 (N-1, 210);
+  return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 1 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
+
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-6.c b/gcc/testsuite/gcc.dg/autopar/reduc-6.c
new file mode 100644 (file)
index 0000000..b3a28a9
--- /dev/null
@@ -0,0 +1,55 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+
+#define N 16
+#define DIFF 242
+
+__attribute__ ((noinline))
+int main1 (float x, float max_result)
+{
+  int i;
+  float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+  float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+  float diff = 2;
+  float max = x;
+  float min = 10;
+
+  for (i = 0; i < N; i++) {
+    diff += (b[i] - c[i]);
+  }
+
+  for (i = 0; i < N; i++) {
+    max = max < c[i] ? c[i] : max;
+  }
+
+  for (i = 0; i < N; i++) {
+    min = min > c[i] ? c[i] : min;
+  }
+
+  /* check results:  */
+  if (diff != DIFF)
+    abort ();
+  if (max != max_result)
+    abort ();
+  if (min != 0)
+    abort ();
+
+  return 0;
+}
+
+int main (void)
+{ 
+  main1 (100 ,100);
+  main1 (0, 15);
+  return 0;
+}
+
+/* need -ffast-math to  parallelize these loops.  */
+/* { dg-final { scan-tree-dump-times "Detected reduction" 0 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 0 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "FAILED: it is not a part of reduction" 3 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-7.c b/gcc/testsuite/gcc.dg/autopar/reduc-7.c
new file mode 100644 (file)
index 0000000..90bbc98
--- /dev/null
@@ -0,0 +1,82 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
+
+#include <stdlib.h>
+
+#define N 32
+
+extern void abort (void);
+typedef unsigned char T;
+
+__attribute__ ((noinline)) void
+testmax (const T *c, T init, T result)
+{
+  T lc[N], accum = init;
+  int i;
+
+  __builtin_memcpy (lc, c, sizeof(lc));
+
+  for (i = 0; i < N; i++) {
+    accum = accum < lc[i] ? lc[i] : accum;
+  }
+
+  if (accum != result)
+    abort ();
+}
+
+__attribute__ ((noinline)) void
+testmin (const T *c, T init, T result)
+{
+  T lc[N], accum = init;
+  int i;
+
+  __builtin_memcpy (lc, c, sizeof(lc));
+
+  for (i = 0; i < N; i++) {
+    accum = accum > lc[i] ? lc[i] : accum;
+  }
+
+  if (accum != result)
+    abort ();
+}
+
+int main (void)
+{ 
+  static unsigned char const A[N] = {
+    0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+    0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
+    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+    0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f
+  };
+
+  static unsigned char const B[N] = {
+    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+    0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
+    0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+    0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f
+  };
+
+  static unsigned char const C[N] = {
+    0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
+    0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
+    0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+  };
+
+  
+  testmin (A, 10, 1);
+  testmin (B, 0x7f, 0x70);
+  testmin (C, 0x7f, 0x09);
+
+  testmax (A, 0, 0x7f);
+  testmax (B, 0, 0x8f);
+  testmax (C, 0, 0xff);
+
+  return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 2 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
+
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-8.c b/gcc/testsuite/gcc.dg/autopar/reduc-8.c
new file mode 100644 (file)
index 0000000..4801dc7
--- /dev/null
@@ -0,0 +1,80 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
+
+#include <stdlib.h>
+
+#define N 32
+
+extern void abort (void);
+typedef signed char T;
+
+__attribute__ ((noinline)) void
+testmax (const T *c, T init, T result)
+{
+  T lc[N], accum = init;
+  int i;
+
+  __builtin_memcpy (lc, c, sizeof(lc));
+
+  for (i = 0; i < N; i++) {
+    accum = accum < lc[i] ? lc[i] : accum;
+  }
+
+  if (accum != result)
+    abort ();
+}
+
+__attribute__ ((noinline)) void
+testmin (const T *c, T init, T result)
+{
+  T lc[N], accum = init;
+  int i;
+
+  __builtin_memcpy (lc, c, sizeof(lc));
+
+  for (i = 0; i < N; i++) {
+    accum = accum > lc[i] ? lc[i] : accum;
+  }
+
+  if (accum != result)
+    abort ();
+}
+
+int main (void)
+{ 
+  static signed char const A[N] = {
+    0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+    0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
+    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+    0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f
+  };
+
+  static signed char const B[N] = {
+    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+    0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
+    0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+    0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f
+  };
+
+  static signed char const C[N] = {
+    0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
+    0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
+    0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+  };
+
+  testmin (A, 0, 0);
+  testmin (B, 0, 0x80);
+  testmin (C, 0, 0x80);
+
+  testmax (A, 0, 0x7f);
+  testmax (B, 0, 0x7f);
+  testmax (C, 0, 0x77);
+
+  return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 2 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-9.c b/gcc/testsuite/gcc.dg/autopar/reduc-9.c
new file mode 100644 (file)
index 0000000..68ed1de
--- /dev/null
@@ -0,0 +1,80 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
+
+#include <stdlib.h>
+
+#define N 32
+
+extern void abort (void);
+typedef unsigned short T;
+
+__attribute__ ((noinline)) void
+testmax (const T *c, T init, T result)
+{
+  T lc[N], accum = init;
+  int i;
+
+  __builtin_memcpy (lc, c, sizeof(lc));
+
+  for (i = 0; i < N; i++) {
+    accum = accum < lc[i] ? lc[i] : accum;
+  }
+
+  if (accum != result)
+    abort ();
+}
+
+__attribute__ ((noinline)) void
+testmin (const T *c, T init, T result)
+{
+  T lc[N], accum = init;
+  int i;
+
+  __builtin_memcpy (lc, c, sizeof(lc));
+
+  for (i = 0; i < N; i++) {
+    accum = accum > lc[i] ? lc[i] : accum;
+  }
+
+  if (accum != result)
+    abort ();
+}
+
+int main (void)
+{ 
+  static unsigned short const A[N] = {
+    0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008,
+    0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010,
+    0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7700,
+    0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff
+  };
+
+  static unsigned short const B[N] = {
+    0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7700,
+    0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff,
+    0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007,
+    0x8008, 0x8009, 0x800a, 0x800b, 0x800c, 0x800d, 0x800e, 0x800f
+  };
+
+  static unsigned short const C[N] = {
+    0xffff, 0xfffe, 0xfffd, 0xfffc, 0xfffb, 0xfffa, 0xfff9, 0xfff8,
+    0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010,
+    0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007,
+    0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7700,
+  };
+
+  testmin (A, 10, 1);
+  testmin (B, 0x7fff, 0x7000);
+  testmin (C, 0x7fff, 0x0009);
+
+  testmax (A, 0, 0x7fff);
+  testmax (B, 0, 0x800f);
+  testmax (C, 0, 0xffff);
+
+  return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 2 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/parallelization-1.c b/gcc/testsuite/gcc.dg/tree-ssa/parallelization-1.c
deleted file mode 100644 (file)
index ee62ff6..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
-
-void abort (void);
-
-void parloop (int N)
-{
-  int i;
-  int x[10000000];
-
-  for (i = 0; i < N; i++)
-    x[i] = i + 3;
-
-  for (i = 0; i < N; i++)
-    {
-      if (x[i] != i + 3)
-       abort ();
-    }
-}
-
-int main(void)
-{
-  parloop(10000000);
-
-  return 0;
-}
-
-/* Check that the first loop in parloop got parallelized.  */
-
-/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops" } } */
-/* { dg-final { scan-tree-dump-times "loopfn" 5 "final_cleanup" } } */
-/* { dg-final { cleanup-tree-dump "parloops" } } */
-/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reduc-1.c b/gcc/testsuite/gcc.dg/tree-ssa/reduc-1.c
deleted file mode 100644 (file)
index c7f53e1..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
-
-#include <stdarg.h>
-#include <stdlib.h>
-
-#define N 16
-#define DIFF 242
-
-/* Reduction of unsigned-int.  */
-
-void main1 (unsigned int x, unsigned int max_result, unsigned int min_result)
-{
-  int i;
-  unsigned int ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
-  unsigned int uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
-  unsigned int udiff = 2;
-  unsigned int umax = x;
-  unsigned int umin = x;
-
-  /* Summation.  */
-  for (i = 0; i < N; i++) {
-    udiff += (ub[i] - uc[i]);
-  }
-
-  /* Maximum.  */
-  for (i = 0; i < N; i++) {
-    umax = umax < uc[i] ? uc[i] : umax;
-  }
-
-  /* Minimum.  */
-  for (i = 0; i < N; i++) {
-    umin = umin > uc[i] ? uc[i] : umin;
-  }
-
-  /* check results:  */
-  if (udiff != DIFF)
-    abort ();
-  if (umax != max_result)
-    abort ();
-  if (umin != min_result)
-    abort ();
-}
-
-int main (void)
-{ 
-  
-  main1 (100, 100, 1);
-  main1 (0, 15, 0);
-  return 0;
-}
-
-/* { dg-final { scan-tree-dump-times "Detected reduction" 3 "parloops" } } */
-/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops" } } */
-/* { dg-final { cleanup-tree-dump "parloops" } } */
-/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
-
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reduc-1char.c b/gcc/testsuite/gcc.dg/tree-ssa/reduc-1char.c
deleted file mode 100644 (file)
index 87f758a..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
-
-#include <stdarg.h>
-#include <stdlib.h>
-
-#define N 16
-#define DIFF 242
-
-__attribute__ ((noinline)) void
-main1 (unsigned char x, unsigned char max_result, unsigned char min_result)
-{
-  int i;
-  unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
-  unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
-  unsigned char udiff = 2;
-  unsigned char umax = x;
-  unsigned char umin = x;
-
-  for (i = 0; i < N; i++) {
-    udiff += (unsigned char)(ub[i] - uc[i]);
-  }
-
-  for (i = 0; i < N; i++) {
-    umax = umax < uc[i] ? uc[i] : umax;
-  }
-
-  for (i = 0; i < N; i++) {
-    umin = umin > uc[i] ? uc[i] : umin;
-  }
-
-  /* check results:  */
-  if (udiff != DIFF)
-    abort ();
-  if (umax != max_result)
-    abort ();
-  if (umin != min_result)
-    abort ();
-}
-
-int main (void)
-{ 
-  main1 (100, 100, 1);
-  main1 (0, 15, 0);
-  return 0;
-}
-
-/* { dg-final { scan-tree-dump-times "Detected reduction" 3 "parloops" } } */
-/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops" } } */
-/* { dg-final { cleanup-tree-dump "parloops" } } */
-/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
-
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reduc-1short.c b/gcc/testsuite/gcc.dg/tree-ssa/reduc-1short.c
deleted file mode 100644 (file)
index 75d0954..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
-
-#include <stdarg.h>
-#include <stdlib.h>
-
-#define N 16
-#define DIFF 242
-
-__attribute__ ((noinline)) void
-main1 (unsigned short x, unsigned short max_result, unsigned short min_result)
-{
-  int i;
-  unsigned short ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
-  unsigned short uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
-  unsigned short  udiff = 2;
-  unsigned short umax = x;
-  unsigned short umin = x;
-
-  for (i = 0; i < N; i++) {
-    udiff += (unsigned short)(ub[i] - uc[i]);
-  }
-
-  for (i = 0; i < N; i++) {
-    umax = umax < uc[i] ? uc[i] : umax;
-  }
-
-  for (i = 0; i < N; i++) {
-    umin = umin > uc[i] ? uc[i] : umin;
-  }
-
-  /* check results:  */
-  if (udiff != DIFF)
-    abort ();
-  if (umax != max_result)
-    abort ();
-  if (umin != min_result)
-    abort ();
-}
-
-int main (void)
-{ 
-  main1 (100, 100, 1);
-  main1 (0, 15, 0);
-  return 0;
-}
-
-/* { dg-final { scan-tree-dump-times "Detected reduction" 3 "parloops" } } */
-/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops" } } */
-/* { dg-final { cleanup-tree-dump "parloops" } } */
-/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
-
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reduc-2.c b/gcc/testsuite/gcc.dg/tree-ssa/reduc-2.c
deleted file mode 100644 (file)
index d462f89..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
-
-#include <stdarg.h>
-#include <stdlib.h>
-
-#define N 16
-#define DIFF 240
-
-/* Reduction of signed-int.  */
-
-__attribute__ ((noinline))
-void main1 (int x, int max_result, int min_result)
-{
-  int i;
-  int b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
-  int c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
-  int diff = 0;
-  int max = x;
-  int min = x;
-
-  for (i = 0; i < N; i++) {
-    diff += (b[i] - c[i]);
-  }
-
-  for (i = 0; i < N; i++) {
-    max = max < c[i] ? c[i] : max;
-  }
-
-  for (i = 0; i < N; i++) {
-    min = min > c[i] ? c[i] : min;
-  }
-
-  /* check results:  */
-  if (diff != DIFF)
-    abort ();
-  if (max != max_result)
-    abort ();
-  if (min != min_result)
-    abort ();
-}
-
-int main (void)
-{ 
-  main1 (100, 100, 1);
-  main1 (0, 15, 0);
-  return 0;
-}
-
-/* { dg-final { scan-tree-dump-times "Detected reduction" 3 "parloops" } } */
-/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops" } } */
-/* { dg-final { cleanup-tree-dump "parloops" } } */
-/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
-
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reduc-2char.c b/gcc/testsuite/gcc.dg/tree-ssa/reduc-2char.c
deleted file mode 100644 (file)
index 15acb3b..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
-
-#include <stdarg.h>
-#include <stdlib.h>
-
-#define N 16
-#define DIFF 121
-
-__attribute__ ((noinline))
-void main1 (signed char x, signed char max_result, signed char min_result)
-{
-  int i;
-  signed char b[N] = {1,2,3,6,8,10,12,14,16,18,20,22,24,26,28,30};
-  signed char c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
-  signed char diff = 2;
-  signed char max = x;
-  signed char min = x;
-
-  for (i = 0; i < N; i++) {
-    diff += (signed char)(b[i] - c[i]);
-  }
-
-  for (i = 0; i < N; i++) {
-    max = max < c[i] ? c[i] : max;
-  }
-
-  for (i = 0; i < N; i++) {
-    min = min > c[i] ? c[i] : min;
-  }
-
-  /* check results:  */
-  if (diff != DIFF)
-    abort ();
-  if (max != max_result)
-    abort ();
-  if (min != min_result)
-    abort ();
-}
-
-int main (void)
-{ 
-  main1 (100, 100, 1);
-  main1 (0, 15, 0);
-  return 0;
-}
-
-/* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */
-/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 2 "parloops" } } */
-/* { dg-final { cleanup-tree-dump "parloops" } } */
-/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
-
-
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reduc-2short.c b/gcc/testsuite/gcc.dg/tree-ssa/reduc-2short.c
deleted file mode 100644 (file)
index f98402e..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
-
-#include <stdarg.h>
-#include <stdlib.h>
-
-#define N 16
-#define DIFF 242
-
-__attribute__ ((noinline))
-void main1 (short x, short max_result, short min_result)
-{
-  int i;
-  short b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
-  short c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
-  short diff = 2;
-  short max = x;
-  short min = x;
-
-  for (i = 0; i < N; i++) {
-    diff += (short)(b[i] - c[i]);
-  }
-  for (i = 0; i < N; i++) {
-    max = max < c[i] ? c[i] : max;
-  }
-
-  for (i = 0; i < N; i++) {
-    min = min > c[i] ? c[i] : min;
-  }
-
-  /* check results:  */
-  if (diff != DIFF)
-    abort ();
-  if (max != max_result)
-    abort ();
-  if (min != min_result)
-    abort ();
-}
-
-int main (void)
-{ 
-  main1 (100, 100, 1);
-  main1 (0, 15, 0);
-  return 0;
-}
-
-/* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */
-/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 2 "parloops" } } */
-/* { dg-final { cleanup-tree-dump "parloops" } } */
-/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
-
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reduc-3.c b/gcc/testsuite/gcc.dg/tree-ssa/reduc-3.c
deleted file mode 100644 (file)
index 31ed2bc..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
-
-#include <stdarg.h>
-#include <stdlib.h>
-
-#define N 16
-
-/* Reduction of unsigned-int.  */
-
-__attribute__ ((noinline))
-int main1 (int n, int res)
-{
-  int i;
-  unsigned int ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
-  unsigned int uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
-  unsigned int udiff;
-
-  udiff = 0;
-  for (i = 0; i < n; i++) {
-    udiff += (ub[i] - uc[i]);
-  }
-
-  /* check results:  */
-  if (udiff != res)
-    abort ();
-
-  return 0;
-}
-
-int main (void)
-{ 
-  main1 (N, 240);
-  main1 (N-1, 210);
-  return 0;
-}
-
-/* { dg-final { scan-tree-dump-times "Detected reduction" 1 "parloops" } } */
-/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops" } } */
-/* { dg-final { cleanup-tree-dump "parloops" } } */
-/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
-
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reduc-6.c b/gcc/testsuite/gcc.dg/tree-ssa/reduc-6.c
deleted file mode 100644 (file)
index b3a28a9..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
-
-#include <stdarg.h>
-#include <stdlib.h>
-
-#define N 16
-#define DIFF 242
-
-__attribute__ ((noinline))
-int main1 (float x, float max_result)
-{
-  int i;
-  float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
-  float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
-  float diff = 2;
-  float max = x;
-  float min = 10;
-
-  for (i = 0; i < N; i++) {
-    diff += (b[i] - c[i]);
-  }
-
-  for (i = 0; i < N; i++) {
-    max = max < c[i] ? c[i] : max;
-  }
-
-  for (i = 0; i < N; i++) {
-    min = min > c[i] ? c[i] : min;
-  }
-
-  /* check results:  */
-  if (diff != DIFF)
-    abort ();
-  if (max != max_result)
-    abort ();
-  if (min != 0)
-    abort ();
-
-  return 0;
-}
-
-int main (void)
-{ 
-  main1 (100 ,100);
-  main1 (0, 15);
-  return 0;
-}
-
-/* need -ffast-math to  parallelize these loops.  */
-/* { dg-final { scan-tree-dump-times "Detected reduction" 0 "parloops" } } */
-/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 0 "parloops" } } */
-/* { dg-final { scan-tree-dump-times "FAILED: it is not a part of reduction" 3 "parloops" } } */
-/* { dg-final { cleanup-tree-dump "parloops" } } */
-/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reduc-7.c b/gcc/testsuite/gcc.dg/tree-ssa/reduc-7.c
deleted file mode 100644 (file)
index 90bbc98..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
-
-#include <stdlib.h>
-
-#define N 32
-
-extern void abort (void);
-typedef unsigned char T;
-
-__attribute__ ((noinline)) void
-testmax (const T *c, T init, T result)
-{
-  T lc[N], accum = init;
-  int i;
-
-  __builtin_memcpy (lc, c, sizeof(lc));
-
-  for (i = 0; i < N; i++) {
-    accum = accum < lc[i] ? lc[i] : accum;
-  }
-
-  if (accum != result)
-    abort ();
-}
-
-__attribute__ ((noinline)) void
-testmin (const T *c, T init, T result)
-{
-  T lc[N], accum = init;
-  int i;
-
-  __builtin_memcpy (lc, c, sizeof(lc));
-
-  for (i = 0; i < N; i++) {
-    accum = accum > lc[i] ? lc[i] : accum;
-  }
-
-  if (accum != result)
-    abort ();
-}
-
-int main (void)
-{ 
-  static unsigned char const A[N] = {
-    0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
-    0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
-    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
-    0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f
-  };
-
-  static unsigned char const B[N] = {
-    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
-    0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
-    0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
-    0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f
-  };
-
-  static unsigned char const C[N] = {
-    0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
-    0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
-    0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
-    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
-  };
-
-  
-  testmin (A, 10, 1);
-  testmin (B, 0x7f, 0x70);
-  testmin (C, 0x7f, 0x09);
-
-  testmax (A, 0, 0x7f);
-  testmax (B, 0, 0x8f);
-  testmax (C, 0, 0xff);
-
-  return 0;
-}
-
-/* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */
-/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 2 "parloops" } } */
-/* { dg-final { cleanup-tree-dump "parloops" } } */
-/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
-
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reduc-8.c b/gcc/testsuite/gcc.dg/tree-ssa/reduc-8.c
deleted file mode 100644 (file)
index 4801dc7..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
-
-#include <stdlib.h>
-
-#define N 32
-
-extern void abort (void);
-typedef signed char T;
-
-__attribute__ ((noinline)) void
-testmax (const T *c, T init, T result)
-{
-  T lc[N], accum = init;
-  int i;
-
-  __builtin_memcpy (lc, c, sizeof(lc));
-
-  for (i = 0; i < N; i++) {
-    accum = accum < lc[i] ? lc[i] : accum;
-  }
-
-  if (accum != result)
-    abort ();
-}
-
-__attribute__ ((noinline)) void
-testmin (const T *c, T init, T result)
-{
-  T lc[N], accum = init;
-  int i;
-
-  __builtin_memcpy (lc, c, sizeof(lc));
-
-  for (i = 0; i < N; i++) {
-    accum = accum > lc[i] ? lc[i] : accum;
-  }
-
-  if (accum != result)
-    abort ();
-}
-
-int main (void)
-{ 
-  static signed char const A[N] = {
-    0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
-    0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
-    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
-    0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f
-  };
-
-  static signed char const B[N] = {
-    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
-    0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
-    0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
-    0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f
-  };
-
-  static signed char const C[N] = {
-    0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
-    0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
-    0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
-    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
-  };
-
-  testmin (A, 0, 0);
-  testmin (B, 0, 0x80);
-  testmin (C, 0, 0x80);
-
-  testmax (A, 0, 0x7f);
-  testmax (B, 0, 0x7f);
-  testmax (C, 0, 0x77);
-
-  return 0;
-}
-
-/* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */
-/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 2 "parloops" } } */
-/* { dg-final { cleanup-tree-dump "parloops" } } */
-/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reduc-9.c b/gcc/testsuite/gcc.dg/tree-ssa/reduc-9.c
deleted file mode 100644 (file)
index 68ed1de..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
-
-#include <stdlib.h>
-
-#define N 32
-
-extern void abort (void);
-typedef unsigned short T;
-
-__attribute__ ((noinline)) void
-testmax (const T *c, T init, T result)
-{
-  T lc[N], accum = init;
-  int i;
-
-  __builtin_memcpy (lc, c, sizeof(lc));
-
-  for (i = 0; i < N; i++) {
-    accum = accum < lc[i] ? lc[i] : accum;
-  }
-
-  if (accum != result)
-    abort ();
-}
-
-__attribute__ ((noinline)) void
-testmin (const T *c, T init, T result)
-{
-  T lc[N], accum = init;
-  int i;
-
-  __builtin_memcpy (lc, c, sizeof(lc));
-
-  for (i = 0; i < N; i++) {
-    accum = accum > lc[i] ? lc[i] : accum;
-  }
-
-  if (accum != result)
-    abort ();
-}
-
-int main (void)
-{ 
-  static unsigned short const A[N] = {
-    0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008,
-    0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010,
-    0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7700,
-    0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff
-  };
-
-  static unsigned short const B[N] = {
-    0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7700,
-    0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff,
-    0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007,
-    0x8008, 0x8009, 0x800a, 0x800b, 0x800c, 0x800d, 0x800e, 0x800f
-  };
-
-  static unsigned short const C[N] = {
-    0xffff, 0xfffe, 0xfffd, 0xfffc, 0xfffb, 0xfffa, 0xfff9, 0xfff8,
-    0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010,
-    0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007,
-    0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7700,
-  };
-
-  testmin (A, 10, 1);
-  testmin (B, 0x7fff, 0x7000);
-  testmin (C, 0x7fff, 0x0009);
-
-  testmax (A, 0, 0x7fff);
-  testmax (B, 0, 0x800f);
-  testmax (C, 0, 0xffff);
-
-  return 0;
-}
-
-/* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */
-/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 2 "parloops" } } */
-/* { dg-final { cleanup-tree-dump "parloops" } } */
-/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
index a723dc635d5aa5047d8231264fdfbea20492d936..7ea9ca0ab27e0f6c0686f8ae6b77cae313cabbba 100644 (file)
@@ -509,6 +509,15 @@ proc check_effective_target_fopenmp {} {
     } "-fopenmp"]
 }
 
+# Return 1 if compilation with -pthread is error-free for trivial
+# code, 0 otherwise.
+
+proc check_effective_target_pthread {} {
+    return [check_no_compiler_messages pthread object {
+       void foo (void) { }
+    } "-pthread"]
+}
+
 # Return 1 if the target supports -fstack-protector
 proc check_effective_target_fstack_protector {} {
     return [check_runtime fstack_protector {