From 48a78aee68fe0d88f01fcdef61782b4f8008f651 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 20 Nov 2015 20:50:46 +0100 Subject: [PATCH] re PR middle-end/68221 (libgomp reduction-11/12 failures) 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. * 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. From-SVN: r230672 --- gcc/ChangeLog | 5 +++++ gcc/omp-low.c | 12 +++++++----- libgomp/ChangeLog | 8 ++++++++ libgomp/testsuite/libgomp.c++/reduction-11.C | 2 +- libgomp/testsuite/libgomp.c++/reduction-12.C | 2 +- libgomp/testsuite/libgomp.c/reduction-11.c | 2 +- libgomp/testsuite/libgomp.c/reduction-12.c | 2 +- 7 files changed, 24 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0b7194b848a..4d3e5b3680f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2015-11-20 Jakub Jelinek + 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. diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 0b6630bb7df..b47864eae6e 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -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; diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 2fff11b170f..7de19b0a25b 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,11 @@ +2015-11-20 Jakub Jelinek + + 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 * libgomp.oacc-c-c++-common/reduction-dbl.c: New. diff --git a/libgomp/testsuite/libgomp.c++/reduction-11.C b/libgomp/testsuite/libgomp.c++/reduction-11.C index 588cc5fd3c3..67c7320cf5c 100644 --- a/libgomp/testsuite/libgomp.c++/reduction-11.C +++ b/libgomp/testsuite/libgomp.c++/reduction-11.C @@ -1,4 +1,4 @@ -// { dg-do run { xfail *-*-* } } +// { dg-do run } char z[10] = { 0 }; diff --git a/libgomp/testsuite/libgomp.c++/reduction-12.C b/libgomp/testsuite/libgomp.c++/reduction-12.C index 744798a91e8..1495549a956 100644 --- a/libgomp/testsuite/libgomp.c++/reduction-12.C +++ b/libgomp/testsuite/libgomp.c++/reduction-12.C @@ -1,4 +1,4 @@ -// { dg-do run { xfail *-*-* } } +// { dg-do run } template struct A diff --git a/libgomp/testsuite/libgomp.c/reduction-11.c b/libgomp/testsuite/libgomp.c/reduction-11.c index 594dc673e03..264c6fc075f 100644 --- a/libgomp/testsuite/libgomp.c/reduction-11.c +++ b/libgomp/testsuite/libgomp.c/reduction-11.c @@ -1,4 +1,4 @@ -/* { dg-do run { xfail *-*-* } } */ +/* { dg-do run } */ char z[10] = { 0 }; diff --git a/libgomp/testsuite/libgomp.c/reduction-12.c b/libgomp/testsuite/libgomp.c/reduction-12.c index 1c9c4f3e3dd..97c5766cf4e 100644 --- a/libgomp/testsuite/libgomp.c/reduction-12.c +++ b/libgomp/testsuite/libgomp.c/reduction-12.c @@ -1,4 +1,4 @@ -/* { dg-do run { xfail *-*-* } } */ +/* { dg-do run } */ struct A { int t; }; struct B { char t; }; -- 2.30.2