Commit f305679f by Jan Hubicka Committed by Jan Hubicka

gcse.c (hoist_expr_reaches_here_p): Stop once expr_bb is reached.


	* gcse.c (hoist_expr_reaches_here_p):  Stop once expr_bb is reached.

	* gcse.c (try_replace_reg): Do not return false positives.

From-SVN: r55553
parent cd095b7d
Thu Jul 18 09:38:59 CEST 2002 Jan Hubicka <jh@suse.cz>
* gcse.c (hoist_expr_reaches_here_p): Stop once expr_bb is reached.
* gcse.c (try_replace_reg): Do not return false positives.
2002-07-18 Alan Modra <amodra@bigpond.net.au> 2002-07-18 Alan Modra <amodra@bigpond.net.au>
* prefix.c: (update_path): Strip ".." components when prior dir * prefix.c: (update_path): Strip ".." components when prior dir
......
...@@ -3971,24 +3971,27 @@ try_replace_reg (from, to, insn) ...@@ -3971,24 +3971,27 @@ try_replace_reg (from, to, insn)
int success = 0; int success = 0;
rtx set = single_set (insn); rtx set = single_set (insn);
success = validate_replace_src (from, to, insn); if (reg_mentioned_p (from, PATTERN (insn)))
{
success = validate_replace_src (from, to, insn);
}
/* If above failed and this is a single set, try to simplify the source of if (!success && set && reg_mentioned_p (from, SET_SRC (set)))
the set given our substitution. We could perhaps try this for multiple
SETs, but it probably won't buy us anything. */
if (!success && set != 0)
{ {
/* If above failed and this is a single set, try to simplify the source of
the set given our substitution. We could perhaps try this for multiple
SETs, but it probably won't buy us anything. */
src = simplify_replace_rtx (SET_SRC (set), from, to); src = simplify_replace_rtx (SET_SRC (set), from, to);
if (!rtx_equal_p (src, SET_SRC (set)) if (!rtx_equal_p (src, SET_SRC (set))
&& validate_change (insn, &SET_SRC (set), src, 0)) && validate_change (insn, &SET_SRC (set), src, 0))
success = 1; success = 1;
}
/* If we've failed to do replacement, have a single SET, and don't already /* If we've failed to do replacement, have a single SET, and don't already
have a note, add a REG_EQUAL note to not lose information. */ have a note, add a REG_EQUAL note to not lose information. */
if (!success && note == 0 && set != 0) if (!success && note == 0 && set != 0)
note = set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src)); note = set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
}
/* If there is already a NOTE, update the expression in it with our /* If there is already a NOTE, update the expression in it with our
replacement. */ replacement. */
...@@ -5879,6 +5882,8 @@ hoist_expr_reaches_here_p (expr_bb, expr_index, bb, visited) ...@@ -5879,6 +5882,8 @@ hoist_expr_reaches_here_p (expr_bb, expr_index, bb, visited)
if (pred->src == ENTRY_BLOCK_PTR) if (pred->src == ENTRY_BLOCK_PTR)
break; break;
else if (pred_bb == expr_bb)
continue;
else if (visited[pred_bb->index]) else if (visited[pred_bb->index])
continue; continue;
......
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