Commit 5e04ef8f by Jan Hubicka Committed by H.J. Lu

re PR target/37055 (Revision 138835 breaks -msse2 -mfpmath=sse -Os)

2008-08-09  Jan Hubicka  <jh@suse.cz>

	PR target/37055
	* optabs.c (maybe_emit_unop_insn): Remove produced code if
	expansion failed.
	(expand_fix): Be prepared for expansion to fail.
	(expand_sfix_optab): Remove instructions if expansion failed.

From-SVN: r138916
parent 708fa3b5
2008-08-09 Jan Hubicka <jh@suse.cz>
PR target/37055
* optabs.c (maybe_emit_unop_insn): Remove produced code if
expansion failed.
(expand_fix): Be prepared for expansion to fail.
(expand_sfix_optab): Remove instructions if expansion failed.
2008-08-09 Anatoly Sokolov <aesok@post.ru> 2008-08-09 Anatoly Sokolov <aesok@post.ru>
* config/avr/avr.c (avr_mcu_types): Move the AT43USB320 device to * config/avr/avr.c (avr_mcu_types): Move the AT43USB320 device to
......
...@@ -3769,6 +3769,7 @@ maybe_emit_unop_insn (int icode, rtx target, rtx op0, enum rtx_code code) ...@@ -3769,6 +3769,7 @@ maybe_emit_unop_insn (int icode, rtx target, rtx op0, enum rtx_code code)
rtx temp; rtx temp;
enum machine_mode mode0 = insn_data[icode].operand[1].mode; enum machine_mode mode0 = insn_data[icode].operand[1].mode;
rtx pat; rtx pat;
rtx last = get_last_insn ();
temp = target; temp = target;
...@@ -3782,7 +3783,10 @@ maybe_emit_unop_insn (int icode, rtx target, rtx op0, enum rtx_code code) ...@@ -3782,7 +3783,10 @@ maybe_emit_unop_insn (int icode, rtx target, rtx op0, enum rtx_code code)
pat = GEN_FCN (icode) (temp, op0); pat = GEN_FCN (icode) (temp, op0);
if (!pat) if (!pat)
{
delete_insns_since (last);
return false; return false;
}
if (INSN_P (pat) && NEXT_INSN (pat) != NULL_RTX && code != UNKNOWN) if (INSN_P (pat) && NEXT_INSN (pat) != NULL_RTX && code != UNKNOWN)
add_equal_note (pat, temp, code, op0, NULL_RTX); add_equal_note (pat, temp, code, op0, NULL_RTX);
...@@ -5157,6 +5161,7 @@ expand_fix (rtx to, rtx from, int unsignedp) ...@@ -5157,6 +5161,7 @@ expand_fix (rtx to, rtx from, int unsignedp)
if (icode != CODE_FOR_nothing) if (icode != CODE_FOR_nothing)
{ {
rtx last = get_last_insn ();
if (fmode != GET_MODE (from)) if (fmode != GET_MODE (from))
from = convert_to_mode (fmode, from, 0); from = convert_to_mode (fmode, from, 0);
...@@ -5170,12 +5175,15 @@ expand_fix (rtx to, rtx from, int unsignedp) ...@@ -5170,12 +5175,15 @@ expand_fix (rtx to, rtx from, int unsignedp)
if (imode != GET_MODE (to)) if (imode != GET_MODE (to))
target = gen_reg_rtx (imode); target = gen_reg_rtx (imode);
emit_unop_insn (icode, target, from, if (maybe_emit_unop_insn (icode, target, from,
doing_unsigned ? UNSIGNED_FIX : FIX); doing_unsigned ? UNSIGNED_FIX : FIX))
{
if (target != to) if (target != to)
convert_move (to, target, unsignedp); convert_move (to, target, unsignedp);
return; return;
} }
delete_insns_since (last);
}
} }
/* For an unsigned conversion, there is one more way to do it. /* For an unsigned conversion, there is one more way to do it.
...@@ -5382,6 +5390,7 @@ expand_sfix_optab (rtx to, rtx from, convert_optab tab) ...@@ -5382,6 +5390,7 @@ expand_sfix_optab (rtx to, rtx from, convert_optab tab)
icode = convert_optab_handler (tab, imode, fmode)->insn_code; icode = convert_optab_handler (tab, imode, fmode)->insn_code;
if (icode != CODE_FOR_nothing) if (icode != CODE_FOR_nothing)
{ {
rtx last = get_last_insn ();
if (fmode != GET_MODE (from)) if (fmode != GET_MODE (from))
from = convert_to_mode (fmode, from, 0); from = convert_to_mode (fmode, from, 0);
...@@ -5389,7 +5398,10 @@ expand_sfix_optab (rtx to, rtx from, convert_optab tab) ...@@ -5389,7 +5398,10 @@ expand_sfix_optab (rtx to, rtx from, convert_optab tab)
target = gen_reg_rtx (imode); target = gen_reg_rtx (imode);
if (!maybe_emit_unop_insn (icode, target, from, UNKNOWN)) if (!maybe_emit_unop_insn (icode, target, from, UNKNOWN))
return false; {
delete_insns_since (last);
continue;
}
if (target != to) if (target != to)
convert_move (to, target, 0); convert_move (to, target, 0);
return true; return true;
......
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