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
This commit is contained in:
Jan Hubicka 2002-07-18 09:40:16 +02:00 committed by Jan Hubicka
parent cd095b7d1f
commit f305679f4e
2 changed files with 22 additions and 11 deletions

View file

@ -1,3 +1,9 @@
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>
* prefix.c: (update_path): Strip ".." components when prior dir

View file

@ -3971,24 +3971,27 @@ try_replace_reg (from, to, insn)
int success = 0;
rtx set = single_set (insn);
success = validate_replace_src (from, to, insn);
/* 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. */
if (!success && set != 0)
if (reg_mentioned_p (from, PATTERN (insn)))
{
success = validate_replace_src (from, to, insn);
}
if (!success && set && reg_mentioned_p (from, SET_SRC (set)))
{
/* 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);
if (!rtx_equal_p (src, SET_SRC (set))
&& validate_change (insn, &SET_SRC (set), src, 0))
success = 1;
}
/* 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. */
if (!success && note == 0 && set != 0)
note = set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
/* 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. */
if (!success && note == 0 && set != 0)
note = set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
}
/* If there is already a NOTE, update the expression in it with our
replacement. */
@ -5879,6 +5882,8 @@ hoist_expr_reaches_here_p (expr_bb, expr_index, bb, visited)
if (pred->src == ENTRY_BLOCK_PTR)
break;
else if (pred_bb == expr_bb)
continue;
else if (visited[pred_bb->index])
continue;