re PR middle-end/45534 (ICE in refs_may_alias_p_1, at tree-ssa-alias.c:1031)

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.

From-SVN: r163913
This commit is contained in:
Richard Biener 2010-09-06 12:14:02 +00:00
parent 84f47d20bb
commit 863a75787c
2 changed files with 27 additions and 13 deletions

View File

@ -1,3 +1,12 @@
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.
@ -5,7 +14,8 @@
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>

View File

@ -324,14 +324,16 @@ valid_mem_ref_p (enum machine_mode mode, addr_space_t as,
/* 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))
@ -689,7 +691,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
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;
@ -705,7 +707,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
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;
}
@ -740,7 +742,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
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;
}
@ -761,7 +763,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
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;
}
@ -783,7 +785,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
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;
}
@ -899,10 +901,12 @@ maybe_fold_tmr (tree 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;
}