Commit 9feff114 by John David Anglin Committed by John David Anglin

re PR rtl-optimization/8705 ([HP-PA] ICE in emit_move_insn_1, at expr.c:3101)

	PR opt/8705
	* gcse.c (try_replace_reg): On a successful substitution of a constant
	into a single set, try to simplify the source of the set.
	* loop.c (scan_loop): Don't try to optimize a MODE_CC set with a
	constant source.

From-SVN: r66060
parent 13e71742
2003-04-24 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR opt/8705
* gcse.c (try_replace_reg): On a successful substitution of a constant
into a single set, try to simplify the source of the set.
* loop.c (scan_loop): Don't try to optimize a MODE_CC set with a
constant source.
2003-04-24 Neil Booth <neil@daikokuya.co.uk> 2003-04-24 Neil Booth <neil@daikokuya.co.uk>
* cpplex.c (cpp_token_len): Tighten up. * cpplex.c (cpp_token_len): Tighten up.
......
...@@ -3963,6 +3963,15 @@ try_replace_reg (from, to, insn) ...@@ -3963,6 +3963,15 @@ try_replace_reg (from, to, insn)
if (num_changes_pending () && apply_change_group ()) if (num_changes_pending () && apply_change_group ())
success = 1; success = 1;
/* Try to simplify SET_SRC if we have substituted a constant. */
if (success && set && CONSTANT_P (to))
{
src = simplify_rtx (SET_SRC (set));
if (src)
validate_change (insn, &SET_SRC (set), src, 0);
}
if (!success && set && reg_mentioned_p (from, SET_SRC (set))) 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 /* If above failed and this is a single set, try to simplify the source of
......
...@@ -833,11 +833,17 @@ scan_loop (loop, flags) ...@@ -833,11 +833,17 @@ scan_loop (loop, flags)
That behavior is incorrect and was removed. */ That behavior is incorrect and was removed. */
insert_temp = 1; insert_temp = 1;
/* Don't try to optimize a MODE_CC set with a constant
source. It probably will be combined with a conditional
jump. */
if (GET_MODE_CLASS (GET_MODE (SET_DEST (set))) == MODE_CC
&& CONSTANT_P (src))
;
/* Don't try to optimize a register that was made /* Don't try to optimize a register that was made
by loop-optimization for an inner loop. by loop-optimization for an inner loop.
We don't know its life-span, so we can't compute We don't know its life-span, so we can't compute
the benefit. */ the benefit. */
if (REGNO (SET_DEST (set)) >= max_reg_before_loop) else if (REGNO (SET_DEST (set)) >= max_reg_before_loop)
; ;
/* Don't move the source and add a reg-to-reg copy: /* Don't move the source and add a reg-to-reg copy:
- with -Os (this certainly increases size), - with -Os (this certainly increases size),
......
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