aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-low.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2015-11-20 20:50:46 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2015-11-20 20:50:46 +0100
commit48a78aee68fe0d88f01fcdef61782b4f8008f651 (patch)
treec24052cb2cd36bcb89e5c282738b57518e6c0e94 /gcc/omp-low.c
parent9a784760f136a97e6cc39816788ca4ddff0193af (diff)
downloadgcc-48a78aee68fe0d88f01fcdef61782b4f8008f651.zip
gcc-48a78aee68fe0d88f01fcdef61782b4f8008f651.tar.gz
gcc-48a78aee68fe0d88f01fcdef61782b4f8008f651.tar.bz2
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
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r--gcc/omp-low.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 0b6630b..b47864e 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;