]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR middle-end/68221
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 20 Nov 2015 19:50:46 +0000 (19:50 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 20 Nov 2015 19:50:46 +0000 (19:50 +0000)
* omp-low.c (lower_rec_input_clauses): If C/C++ array reduction
has non-zero bias, subtract it in integer type instead of
pointer plus of negated bias.

* testsuite/libgomp.c/reduction-11.c: Remove xfail.
* testsuite/libgomp.c/reduction-12.c: Likewise.
* testsuite/libgomp.c++/reduction-11.C: Likewise.
* testsuite/libgomp.c++/reduction-12.C: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230672 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/omp-low.c
libgomp/ChangeLog
libgomp/testsuite/libgomp.c++/reduction-11.C
libgomp/testsuite/libgomp.c++/reduction-12.C
libgomp/testsuite/libgomp.c/reduction-11.c
libgomp/testsuite/libgomp.c/reduction-12.c

index 0b7194b848af28b60af81606135e335e1c8bd3e5..4d3e5b3680f57830ee210ccdda7d493a0aadca64 100644 (file)
@@ -1,5 +1,10 @@
 2015-11-20  Jakub Jelinek  <jakub@redhat.com>
 
+       PR middle-end/68221
+       * omp-low.c (lower_rec_input_clauses): If C/C++ array reduction
+       has non-zero bias, subtract it in integer type instead of
+       pointer plus of negated bias.
+
        PR middle-end/68339
        * omp-low.c (expand_simd_clones): Call node->get_body () before
        allocating stuff in GC.
index 0b6630bb7df5d367db5533bcce467068a2bef9e3..b47864eae6e94d6f35689ab568ce41b149334c74 100644 (file)
@@ -4444,11 +4444,13 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
 
              if (!integer_zerop (bias))
                {
-                 bias = fold_convert_loc (clause_loc, sizetype, bias);
-                 bias = fold_build1_loc (clause_loc, NEGATE_EXPR,
-                                         sizetype, bias);
-                 x = fold_build2_loc (clause_loc, POINTER_PLUS_EXPR,
-                                      TREE_TYPE (x), x, bias);
+                 bias = fold_convert_loc (clause_loc, pointer_sized_int_node,
+                                          bias);
+                 yb = fold_convert_loc (clause_loc, pointer_sized_int_node,
+                                        x);
+                 yb = fold_build2_loc (clause_loc, MINUS_EXPR,
+                                       pointer_sized_int_node, yb, bias);
+                 x = fold_convert_loc (clause_loc, TREE_TYPE (x), yb);
                  yb = create_tmp_var (ptype, name);
                  gimplify_assign (yb, x, ilist);
                  x = yb;
index 2fff11b170f6f7536175885f94bf757813bc7899..7de19b0a25bfaa2d6cf72758a3aca9c55ed741ba 100644 (file)
@@ -1,3 +1,11 @@
+2015-11-20  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/68221
+       * testsuite/libgomp.c/reduction-11.c: Remove xfail.
+       * testsuite/libgomp.c/reduction-12.c: Likewise.
+       * testsuite/libgomp.c++/reduction-11.C: Likewise.
+       * testsuite/libgomp.c++/reduction-12.C: Likewise.
+
 2015-11-19  Nathan Sidwell  <nathan@codesourcery.com>
 
        * libgomp.oacc-c-c++-common/reduction-dbl.c: New.
index 588cc5fd3c395803e68be6230b25da28b8ce368e..67c7320cf5c78017e69c90db366793e8ccb38231 100644 (file)
@@ -1,4 +1,4 @@
-// { dg-do run { xfail *-*-* } }
+// { dg-do run }
 
 char z[10] = { 0 };
 
index 744798a91e86db6eb8c1817419f0fd2df0be73ab..1495549a956ed0ae34be8c48325cc5c1e8f20617 100644 (file)
@@ -1,4 +1,4 @@
-// { dg-do run { xfail *-*-* } }
+// { dg-do run }
 
 template <typename T>
 struct A
index 594dc673e035119630f54f504e2ab47340da16cf..264c6fc075f6e545fced6b45f3c51bd4a628078b 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-do run { xfail *-*-* } } */
+/* { dg-do run } */
 
 char z[10] = { 0 };
 
index 1c9c4f3e3ddc37f6c1e22ac33f4d6654df1da276..97c5766cf4edf914e1ff499588fc6a1fcc8be491 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-do run { xfail *-*-* } } */
+/* { dg-do run } */
 
 struct A { int t; };
 struct B { char t; };