diff options
author | Tom de Vries <tom@codesourcery.com> | 2015-08-29 07:07:51 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2015-08-29 07:07:51 +0000 |
commit | 3ff2d74e9cfb4342f610b058eab400d3fde55f56 (patch) | |
tree | 9bf08e641c221177e8d579382c0f807bde76c21f /gcc/omp-low.c | |
parent | 40e1e8d7b9092973e769e92a559e764c74c71cac (diff) | |
download | gcc-3ff2d74e9cfb4342f610b058eab400d3fde55f56.zip gcc-3ff2d74e9cfb4342f610b058eab400d3fde55f56.tar.gz gcc-3ff2d74e9cfb4342f610b058eab400d3fde55f56.tar.bz2 |
Handle mix/max pointer reductions in parloops
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.
* gcc.dg/autopar/pr46193.c: New test.
* testsuite/libgomp.c/pr46193.c: New test.
From-SVN: r227315
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r-- | gcc/omp-low.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 19f34ec..aa2a598 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -3412,6 +3412,12 @@ omp_reduction_init (tree clause, tree type) 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)); @@ -3428,6 +3434,12 @@ omp_reduction_init (tree clause, tree 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)); |