Commit 863a7578 by Richard Biener

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
parent 84f47d20
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> 2010-09-06 Andreas Schwab <schwab@redhat.com>
* configure.ac: Quote argument of AC_MSG_WARN. * configure.ac: Quote argument of AC_MSG_WARN.
...@@ -5,7 +14,8 @@ ...@@ -5,7 +14,8 @@
2010-09-06 Alexander Monakov <amonakov@ispras.ru> 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. * sel-sched-ir.c (maybe_tidy_empty_bb): Export.
2010-09-06 Andrey Belevantsev <abel@ispras.ru> 2010-09-06 Andrey Belevantsev <abel@ispras.ru>
......
...@@ -324,14 +324,16 @@ valid_mem_ref_p (enum machine_mode mode, addr_space_t as, ...@@ -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 /* 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 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 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; 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; return NULL_TREE;
if (addr->step && integer_onep (addr->step)) if (addr->step && integer_onep (addr->step))
...@@ -689,7 +691,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr, ...@@ -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); addr_to_parts (type, addr, iv_cand, base_hint, &parts, speed);
gimplify_mem_ref_parts (gsi, &parts); 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) if (mem_ref)
return mem_ref; return mem_ref;
...@@ -705,7 +707,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr, ...@@ -705,7 +707,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
true, NULL_TREE, true, GSI_SAME_STMT); true, NULL_TREE, true, GSI_SAME_STMT);
parts.step = NULL_TREE; 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) if (mem_ref)
return mem_ref; return mem_ref;
} }
...@@ -740,7 +742,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr, ...@@ -740,7 +742,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
parts.base = tmp; parts.base = tmp;
parts.symbol = NULL_TREE; 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) if (mem_ref)
return mem_ref; return mem_ref;
} }
...@@ -761,7 +763,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr, ...@@ -761,7 +763,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
parts.base = parts.index; parts.base = parts.index;
parts.index = NULL_TREE; 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) if (mem_ref)
return mem_ref; return mem_ref;
} }
...@@ -783,7 +785,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr, ...@@ -783,7 +785,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
parts.offset = NULL_TREE; 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) if (mem_ref)
return mem_ref; return mem_ref;
} }
...@@ -899,10 +901,12 @@ maybe_fold_tmr (tree ref) ...@@ -899,10 +901,12 @@ maybe_fold_tmr (tree ref)
if (!changed) if (!changed)
return NULL_TREE; return NULL_TREE;
ret = create_mem_ref_raw (TREE_TYPE (ref), TREE_TYPE (addr.offset), &addr); /* If we have propagated something into this TARGET_MEM_REF and thus
if (!ret) ended up folding it, always create a new TARGET_MEM_REF regardless
return NULL_TREE; 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); copy_mem_ref_info (ret, ref);
return ret; return ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment