aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>2012-09-26 16:49:32 +0000
committerWilliam Schmidt <wschmidt@gcc.gnu.org>2012-09-26 16:49:32 +0000
commit502514254fe172a687c21afd96777a33f3c4e11f (patch)
tree8ef57b5a01485028ede63b3b1c1fd0a19803cb45
parent5bfed9a91f036d8c168afebfd8e9dd34e2919c9a (diff)
downloadgcc-502514254fe172a687c21afd96777a33f3c4e11f.zip
gcc-502514254fe172a687c21afd96777a33f3c4e11f.tar.gz
gcc-502514254fe172a687c21afd96777a33f3c4e11f.tar.bz2
re PR tree-optimization/54674 (ICE in build2_stat, at tree.c:3835)
2012-09-26 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/54674 * gimple-ssa-strength-reduction.c (analyze_increments): Don't introduce a multiplication with a pointer operand. From-SVN: r191765
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gimple-ssa-strength-reduction.c11
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c2c072d..afcee64 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2012-09-26 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR tree-optimization/54674
+ * gimple-ssa-strength-reduction.c (analyze_increments): Don't
+ introduce a multiplication with a pointer operand.
+
2012-09-26 Georg-Johann Lay <avr@gjlay.de>
PR middle-end/54635
diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c
index 87684b3..46600a5 100644
--- a/gcc/gimple-ssa-strength-reduction.c
+++ b/gcc/gimple-ssa-strength-reduction.c
@@ -2028,6 +2028,17 @@ analyze_increments (slsr_cand_t first_dep, enum machine_mode mode, bool speed)
incr_vec[i].cost = COST_INFINITE;
+ /* If we need to add an initializer, make sure we don't introduce
+ a multiply by a pointer type, which can happen in certain cast
+ scenarios. FIXME: When cleaning up these cast issues, we can
+ afford to introduce the multiply provided we cast out to an
+ unsigned int of appropriate size. */
+ else if (!incr_vec[i].initializer
+ && TREE_CODE (first_dep->stride) != INTEGER_CST
+ && POINTER_TYPE_P (TREE_TYPE (first_dep->stride)))
+
+ incr_vec[i].cost = COST_INFINITE;
+
/* For any other increment, if this is a multiply candidate, we
must introduce a temporary T and initialize it with
T_0 = stride * increment. When optimizing for speed, walk the