PR tree-optimization/55350
* gimple-ssa-strength-reduction.c (replace_dependent): Handle
POINTER_{PLUS,MINUS}_EXPR correctly.
From-SVN: r193672
+2012-11-20 Aldy Hernandez <aldyh@redhat.com>
+
+ PR tree-optimization/55350
+ * gimple-ssa-strength-reduction.c (replace_dependent): Handle
+ POINTER_PLUS_EXPR correctly.
+
2012-11-20 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (fix_trunc<MODEF:mode><SWI48:mode>_sse): Macroize
basis = lookup_cand (c->basis);
basis_name = gimple_assign_lhs (basis->cand_stmt);
- incr_type = TREE_TYPE (gimple_assign_rhs1 (c->cand_stmt));
- code = PLUS_EXPR;
+ if (cand_code == POINTER_PLUS_EXPR)
+ {
+ incr_type = sizetype;
+ code = cand_code;
+ }
+ else
+ {
+ incr_type = TREE_TYPE (gimple_assign_rhs1 (c->cand_stmt));
+ code = PLUS_EXPR;
+ }
- if (bump.is_negative ())
+ if (bump.is_negative ()
+ && cand_code != POINTER_PLUS_EXPR)
{
code = MINUS_EXPR;
bump = -bump;
--- /dev/null
+void
+foo (__INTPTR_TYPE__ x, __INTPTR_TYPE__ y)
+{
+ int i;
+ void **a = (void *) (8UL * (x / 8UL));
+ for (i = 0; i < x; i++)
+ a[i] = (void *) y;
+}