+2007-12-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/33453
+ * tree-data-ref.c (split_constant_offset): Use POINTER_PLUS_EXPR
+ for pointer addition.
+ * tree-parloops.c (canonicalize_loop_ivs): Likewise.
+ (separate_decls_in_loop_name): Copy DECL_GIMPLE_REG_P from var to
+ var_copy.
+
2007-12-03 Bernd Schmidt <bernd.schmidt@analog.com>
* config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Define __FDPIC__ as
2007-12-03 Razya Ladelsky <razya@il.ibm.com>
- * doc/invoke.texi (fipa-cp, fipa-matrix-reorg): Add documentation.
-
+ * doc/invoke.texi (fipa-cp, fipa-matrix-reorg): Add documentation.
2007-12-03 Jakub Jelinek <jakub@redhat.com>
{
split_constant_offset (poffset, &poffset, &off1);
off0 = size_binop (PLUS_EXPR, off0, off1);
- base = fold_build2 (PLUS_EXPR, TREE_TYPE (base),
- base,
- fold_convert (TREE_TYPE (base), poffset));
+ if (POINTER_TYPE_P (TREE_TYPE (base)))
+ base = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (base),
+ base, fold_convert (sizetype, poffset));
+ else
+ base = fold_build2 (PLUS_EXPR, TREE_TYPE (base), base,
+ fold_convert (TREE_TYPE (base), poffset));
}
var0 = fold_convert (type, base);
if (!*dslot)
{
var_copy = create_tmp_var (TREE_TYPE (var), get_name (var));
+ DECL_GIMPLE_REG_P (var_copy) = DECL_GIMPLE_REG_P (var);
add_referenced_var (var_copy);
nielt = XNEW (struct int_tree_map);
nielt->uid = uid;
canonicalize_loop_ivs (struct loop *loop, htab_t reduction_list, tree nit)
{
unsigned precision = TYPE_PRECISION (TREE_TYPE (nit));
- tree phi, prev, res, type, var_before, val, atype, t, next;
+ tree phi, prev, res, type, var_before, val, atype, mtype, t, next;
block_stmt_iterator bsi;
bool ok;
affine_iv iv;
remove_phi_node (phi, prev, false);
atype = TREE_TYPE (res);
- val = fold_build2 (PLUS_EXPR, atype,
- unshare_expr (iv.base),
- fold_build2 (MULT_EXPR, atype,
- unshare_expr (iv.step),
- fold_convert (atype, var_before)));
+ mtype = POINTER_TYPE_P (atype) ? sizetype : atype;
+ val = fold_build2 (MULT_EXPR, mtype, unshare_expr (iv.step),
+ fold_convert (mtype, var_before));
+ val = fold_build2 (POINTER_TYPE_P (atype)
+ ? POINTER_PLUS_EXPR : PLUS_EXPR,
+ atype, unshare_expr (iv.base), val);
val = force_gimple_operand_bsi (&bsi, val, false, NULL_TREE, true,
BSI_SAME_STMT);
t = build_gimple_modify_stmt (res, val);