Commit 8051c2eb by Alan Modra Committed by Alan Modra

re PR rtl-optimization/14119 (libjava Array_3 test fails at -O1)

	PR optimization/14119
	* combine.c (try_combine): When attemting to fix unrecognized insns,
	don't delete SETs marked with REG_EH_REGION notes.

From-SVN: r77991
parent db33236e
2004-02-18 Alan Modra <amodra@bigpond.net.au>
PR optimization/14119
* combine.c (try_combine): When attemting to fix unrecognized insns,
don't delete SETs marked with REG_EH_REGION notes.
2004-02-17 Ulrich Weigand <uweigand@de.ibm.com> 2004-02-17 Ulrich Weigand <uweigand@de.ibm.com>
* combine.c (simplify_if_then_else): Do not replace * combine.c (simplify_if_then_else): Do not replace
......
...@@ -2017,7 +2017,8 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) ...@@ -2017,7 +2017,8 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p)
insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes); insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes);
/* If the result isn't valid, see if it is a PARALLEL of two SETs where /* If the result isn't valid, see if it is a PARALLEL of two SETs where
the second SET's destination is a register that is unused. In that case, the second SET's destination is a register that is unused and isn't
marked as an instruction that might trap in an EH region. In that case,
we just need the first SET. This can occur when simplifying a divmod we just need the first SET. This can occur when simplifying a divmod
insn. We *must* test for this case here because the code below that insn. We *must* test for this case here because the code below that
splits two independent SETs doesn't handle this case correctly when it splits two independent SETs doesn't handle this case correctly when it
...@@ -2033,37 +2034,42 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) ...@@ -2033,37 +2034,42 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p)
{ {
rtx set0 = XVECEXP (newpat, 0, 0); rtx set0 = XVECEXP (newpat, 0, 0);
rtx set1 = XVECEXP (newpat, 0, 1); rtx set1 = XVECEXP (newpat, 0, 1);
rtx note;
if (((GET_CODE (SET_DEST (set1)) == REG if (((GET_CODE (SET_DEST (set1)) == REG
&& find_reg_note (i3, REG_UNUSED, SET_DEST (set1))) && find_reg_note (i3, REG_UNUSED, SET_DEST (set1)))
|| (GET_CODE (SET_DEST (set1)) == SUBREG || (GET_CODE (SET_DEST (set1)) == SUBREG
&& find_reg_note (i3, REG_UNUSED, SUBREG_REG (SET_DEST (set1))))) && find_reg_note (i3, REG_UNUSED, SUBREG_REG (SET_DEST (set1)))))
&& ! side_effects_p (SET_SRC (set1))) && (!(note = find_reg_note (i3, REG_EH_REGION, NULL_RTX))
{ || INTVAL (XEXP (note, 0)) <= 0)
newpat = set0; && ! side_effects_p (SET_SRC (set1)))
insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes); {
} newpat = set0;
insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes);
}
else if (((GET_CODE (SET_DEST (set0)) == REG else if (((GET_CODE (SET_DEST (set0)) == REG
&& find_reg_note (i3, REG_UNUSED, SET_DEST (set0))) && find_reg_note (i3, REG_UNUSED, SET_DEST (set0)))
|| (GET_CODE (SET_DEST (set0)) == SUBREG || (GET_CODE (SET_DEST (set0)) == SUBREG
&& find_reg_note (i3, REG_UNUSED, && find_reg_note (i3, REG_UNUSED,
SUBREG_REG (SET_DEST (set0))))) SUBREG_REG (SET_DEST (set0)))))
&& ! side_effects_p (SET_SRC (set0))) && (!(note = find_reg_note (i3, REG_EH_REGION, NULL_RTX))
{ || INTVAL (XEXP (note, 0)) <= 0)
newpat = set1; && ! side_effects_p (SET_SRC (set0)))
insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes); {
newpat = set1;
if (insn_code_number >= 0) insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes);
{
/* If we will be able to accept this, we have made a if (insn_code_number >= 0)
change to the destination of I3. This requires us to {
do a few adjustments. */ /* If we will be able to accept this, we have made a
change to the destination of I3. This requires us to
PATTERN (i3) = newpat; do a few adjustments. */
adjust_for_new_dest (i3);
} PATTERN (i3) = newpat;
} adjust_for_new_dest (i3);
}
}
} }
/* If we were combining three insns and the result is a simple SET /* If we were combining three insns and the result is a simple SET
......
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