diff options
author | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2016-12-05 21:48:27 +0000 |
---|---|---|
committer | William Schmidt <wschmidt@gcc.gnu.org> | 2016-12-05 21:48:27 +0000 |
commit | 8907a722fdfbe6992b4c5ee7ee5fa939213154af (patch) | |
tree | 0a5f62e2cc37663d0612d60f94a404ce5ea2ff31 | |
parent | e3cc0f6bb67b012c26d3e7a5e2e76a90456c4d16 (diff) | |
download | gcc-8907a722fdfbe6992b4c5ee7ee5fa939213154af.zip gcc-8907a722fdfbe6992b4c5ee7ee5fa939213154af.tar.gz gcc-8907a722fdfbe6992b4c5ee7ee5fa939213154af.tar.bz2 |
re PR tree-optimization/78646 (incorrect result type for pointer addition in slsr)
2016-12-05 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Stefan Freudenberger <stefan@reservoir.com>
PR tree-optimization/78646
* gimple-ssa-strength-reduction.c (replace_ref): The pointer
addition used for the memory base expression should have the type
of the candidate.
Co-Authored-By: Stefan Freudenberger <stefan@reservoir.com>
From-SVN: r243272
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/gimple-ssa-strength-reduction.c | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 57c2450..beef921 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2016-12-05 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + Stefan Freudenberger <stefan@reservoir.com> + + PR tree-optimization/78646 + * gimple-ssa-strength-reduction.c (replace_ref): The pointer + addition used for the memory base expression should have the type + of the candidate. + 2016-12-05 Waldemar Brodkorb <wbx@openadk.org> PR target/71721 diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c index bdfdb9a..21dcbb0 100644 --- a/gcc/gimple-ssa-strength-reduction.c +++ b/gcc/gimple-ssa-strength-reduction.c @@ -1921,7 +1921,7 @@ replace_ref (tree *expr, slsr_cand_t c) if (align < TYPE_ALIGN (acc_type)) acc_type = build_aligned_type (acc_type, align); - add_expr = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (c->base_expr), + add_expr = fold_build2 (POINTER_PLUS_EXPR, c->cand_type, c->base_expr, c->stride); mem_ref = fold_build2 (MEM_REF, acc_type, add_expr, wide_int_to_tree (c->cand_type, c->index)); |