+2015-08-29 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/46193
+ * omp-low.c (omp_reduction_init): Handle pointer type for min or max
+ clause.
+
2015-08-28 Jeff Law <law@redhat.com>
PR lto/66752
real_maxval (&min, 1, TYPE_MODE (type));
return build_real (type, min);
}
+ else if (POINTER_TYPE_P (type))
+ {
+ wide_int min
+ = wi::min_value (TYPE_PRECISION (type), TYPE_SIGN (type));
+ return wide_int_to_tree (type, min);
+ }
else
{
gcc_assert (INTEGRAL_TYPE_P (type));
real_maxval (&max, 0, TYPE_MODE (type));
return build_real (type, max);
}
+ else if (POINTER_TYPE_P (type))
+ {
+ wide_int max
+ = wi::max_value (TYPE_PRECISION (type), TYPE_SIGN (type));
+ return wide_int_to_tree (type, max);
+ }
else
{
gcc_assert (INTEGRAL_TYPE_P (type));
+2015-08-29 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/46193
+ * gcc.dg/autopar/pr46193.c: New test.
+
2015-08-28 Nathan Sidwell <nathan@acm.org>
* gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c: Simply
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
+
+extern void abort (void);
+
+char *
+foo (int count, char **list)
+{
+ char *minaddr = list[0];
+ int i;
+
+ for (i = 0; i < count; i++)
+ {
+ char *addr = list[i];
+ if (addr < minaddr)
+ minaddr = addr;
+ }
+
+ return minaddr;
+}
+
+char *
+foo2 (int count, char **list)
+{
+ char *maxaddr = list[0];
+ int i;
+
+ for (i = 0; i < count; i++)
+ {
+ char *addr = list[i];
+ if (addr > maxaddr)
+ maxaddr = addr;
+ }
+
+ return maxaddr;
+}
+
+/* { dg-final { scan-tree-dump-times "parallelizing inner loop" 2 "parloops" } } */
+2015-08-29 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/46193
+ * testsuite/libgomp.c/pr46193.c: New test.
+
2015-08-24 Nathan Sidwell <nathan@codesourcery.com>
libgomp/
--- /dev/null
+/* { dg-do run } */
+/* { dg-additional-options "-ftree-parallelize-loops=2" } */
+
+extern void abort (void);
+
+char *
+foo (int count, char **list)
+{
+ char *minaddr = list[0];
+ int i;
+
+ for (i = 0; i < count; i++)
+ {
+ char *addr = list[i];
+ if (addr < minaddr)
+ minaddr = addr;
+ }
+
+ return minaddr;
+}
+
+char *
+foo2 (int count, char **list)
+{
+ char *maxaddr = list[0];
+ int i;
+
+ for (i = 0; i < count; i++)
+ {
+ char *addr = list[i];
+ if (addr > maxaddr)
+ maxaddr = addr;
+ }
+
+ return maxaddr;
+}
+
+#define N 5
+
+static void
+init (char **list)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ list[i] = (char *)&list[i];
+}
+
+int
+main (void)
+{
+ char *list[N];
+ char * res;
+
+ init (list);
+
+ res = foo (N, list);
+
+ if (res != (char *)&list[0])
+ abort ();
+
+ res = foo2 (N, list);
+
+ if (res != (char *)&list[N-1])
+ abort ();
+
+ return 0;
+}