+2010-09-06 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/45534
+ * tree-ssa-address.c (create_mem_ref_raw): Add verify parameter.
+ (create_mem_ref): Do verify the created TARGET_MEM_REF is valid
+ on the target.
+ (maybe_fold_tmr): Do not verify the created TARGET_MEM_REF is
+ valid on the target.
+
2010-09-06 Andreas Schwab <schwab@redhat.com>
* configure.ac: Quote argument of AC_MSG_WARN.
2010-09-06 Alexander Monakov <amonakov@ispras.ru>
- * sel-sched.c (move_cond_jump): Correct arguments to maybe_tidy_empty_bb.
+ * sel-sched.c (move_cond_jump): Correct arguments to
+ maybe_tidy_empty_bb.
* sel-sched-ir.c (maybe_tidy_empty_bb): Export.
2010-09-06 Andrey Belevantsev <abel@ispras.ru>
/* Checks whether a TARGET_MEM_REF with type TYPE and parameters given by ADDR
is valid on the current target and if so, creates and returns the
- TARGET_MEM_REF. */
+ TARGET_MEM_REF. If VERIFY is false omit the verification step. */
static tree
-create_mem_ref_raw (tree type, tree alias_ptr_type, struct mem_address *addr)
+create_mem_ref_raw (tree type, tree alias_ptr_type, struct mem_address *addr,
+ bool verify)
{
tree base, index2;
- if (!valid_mem_ref_p (TYPE_MODE (type), TYPE_ADDR_SPACE (type), addr))
+ if (verify
+ && !valid_mem_ref_p (TYPE_MODE (type), TYPE_ADDR_SPACE (type), addr))
return NULL_TREE;
if (addr->step && integer_onep (addr->step))
addr_to_parts (type, addr, iv_cand, base_hint, &parts, speed);
gimplify_mem_ref_parts (gsi, &parts);
- mem_ref = create_mem_ref_raw (type, alias_ptr_type, &parts);
+ mem_ref = create_mem_ref_raw (type, alias_ptr_type, &parts, true);
if (mem_ref)
return mem_ref;
true, NULL_TREE, true, GSI_SAME_STMT);
parts.step = NULL_TREE;
- mem_ref = create_mem_ref_raw (type, alias_ptr_type, &parts);
+ mem_ref = create_mem_ref_raw (type, alias_ptr_type, &parts, true);
if (mem_ref)
return mem_ref;
}
parts.base = tmp;
parts.symbol = NULL_TREE;
- mem_ref = create_mem_ref_raw (type, alias_ptr_type, &parts);
+ mem_ref = create_mem_ref_raw (type, alias_ptr_type, &parts, true);
if (mem_ref)
return mem_ref;
}
parts.base = parts.index;
parts.index = NULL_TREE;
- mem_ref = create_mem_ref_raw (type, alias_ptr_type, &parts);
+ mem_ref = create_mem_ref_raw (type, alias_ptr_type, &parts, true);
if (mem_ref)
return mem_ref;
}
parts.offset = NULL_TREE;
- mem_ref = create_mem_ref_raw (type, alias_ptr_type, &parts);
+ mem_ref = create_mem_ref_raw (type, alias_ptr_type, &parts, true);
if (mem_ref)
return mem_ref;
}
if (!changed)
return NULL_TREE;
- ret = create_mem_ref_raw (TREE_TYPE (ref), TREE_TYPE (addr.offset), &addr);
- if (!ret)
- return NULL_TREE;
-
+ /* If we have propagated something into this TARGET_MEM_REF and thus
+ ended up folding it, always create a new TARGET_MEM_REF regardless
+ if it is valid in this for on the target - the propagation result
+ wouldn't be anyway. */
+ ret = create_mem_ref_raw (TREE_TYPE (ref),
+ TREE_TYPE (addr.offset), &addr, false);
copy_mem_ref_info (ret, ref);
return ret;
}