]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR tree-optimization/78646 (incorrect result type for pointer addition...
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Wed, 7 Dec 2016 01:08:40 +0000 (01:08 +0000)
committerWilliam Schmidt <wschmidt@gcc.gnu.org>
Wed, 7 Dec 2016 01:08:40 +0000 (01:08 +0000)
2016-12-06  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

Backport from mainline
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.

From-SVN: r243331

gcc/ChangeLog
gcc/gimple-ssa-strength-reduction.c

index 382004e3e2539b6580e4e2d64d99732a3946bc0d..7a2498e3dedf2d3fb9a67370a7a84d3142c4728d 100644 (file)
@@ -1,3 +1,14 @@
+2016-12-06  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
+
+       Backport from mainline
+       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-02  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        Backport from mainline
index b9598a127d6daddfae12a487c8f909fa5b2f83fe..4c4610e28d014154a7422f1aeb54b59759bdcc21 100644 (file)
@@ -1918,7 +1918,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));