Commit 918d445f by Uros Bizjak Committed by Uros Bizjak

i386.c (ix86_legitimize_address): Call convert_to_mode unconditionally.

	* config/i386/i386.c (ix86_legitimize_address): Call convert_to_mode
	unconditionally.
	(ix86_expand_move): Ditto.
	(ix86_zero_extend_to_Pmode): Ditto.
	(ix86_expand_call): Ditto.
	(ix86_expand_special_args_builtin): Ditto.
	(ix86_expand_builtin): Ditto.

From-SVN: r194913
parent 82f2836c
2013-01-04 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.c (ix86_legitimize_address): Call convert_to_mode
unconditionally.
(ix86_expand_move): Ditto.
(ix86_zero_extend_to_Pmode): Ditto.
(ix86_expand_call): Ditto.
(ix86_expand_special_args_builtin): Ditto.
(ix86_expand_builtin): Ditto.
2013-01-04 Richard Biener <rguenther@suse.de> 2013-01-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/55862 PR tree-optimization/55862
......
...@@ -13247,8 +13247,7 @@ ix86_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, ...@@ -13247,8 +13247,7 @@ ix86_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
rtx val = force_operand (XEXP (x, 1), temp); rtx val = force_operand (XEXP (x, 1), temp);
if (val != temp) if (val != temp)
{ {
if (GET_MODE (val) != Pmode) val = convert_to_mode (Pmode, val, 1);
val = convert_to_mode (Pmode, val, 1);
emit_move_insn (temp, val); emit_move_insn (temp, val);
} }
...@@ -13262,8 +13261,7 @@ ix86_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, ...@@ -13262,8 +13261,7 @@ ix86_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
rtx val = force_operand (XEXP (x, 0), temp); rtx val = force_operand (XEXP (x, 0), temp);
if (val != temp) if (val != temp)
{ {
if (GET_MODE (val) != Pmode) val = convert_to_mode (Pmode, val, 1);
val = convert_to_mode (Pmode, val, 1);
emit_move_insn (temp, val); emit_move_insn (temp, val);
} }
...@@ -15931,8 +15929,7 @@ ix86_expand_move (enum machine_mode mode, rtx operands[]) ...@@ -15931,8 +15929,7 @@ ix86_expand_move (enum machine_mode mode, rtx operands[])
op1 = force_operand (op1, op0); op1 = force_operand (op1, op0);
if (op1 == op0) if (op1 == op0)
return; return;
if (GET_MODE (op1) != mode) op1 = convert_to_mode (mode, op1, 1);
op1 = convert_to_mode (mode, op1, 1);
} }
else if (TARGET_DLLIMPORT_DECL_ATTRIBUTES else if (TARGET_DLLIMPORT_DECL_ATTRIBUTES
&& SYMBOL_REF_DLLIMPORT_P (op1)) && SYMBOL_REF_DLLIMPORT_P (op1))
...@@ -16013,8 +16010,7 @@ ix86_expand_move (enum machine_mode mode, rtx operands[]) ...@@ -16013,8 +16010,7 @@ ix86_expand_move (enum machine_mode mode, rtx operands[])
op1 = legitimize_pic_address (op1, reg); op1 = legitimize_pic_address (op1, reg);
if (op0 == op1) if (op0 == op1)
return; return;
if (GET_MODE (op1) != mode) op1 = convert_to_mode (mode, op1, 1);
op1 = convert_to_mode (mode, op1, 1);
} }
} }
} }
...@@ -21650,9 +21646,7 @@ ix86_adjust_counter (rtx countreg, HOST_WIDE_INT value) ...@@ -21650,9 +21646,7 @@ ix86_adjust_counter (rtx countreg, HOST_WIDE_INT value)
rtx rtx
ix86_zero_extend_to_Pmode (rtx exp) ix86_zero_extend_to_Pmode (rtx exp)
{ {
if (GET_MODE (exp) != Pmode) return force_reg (Pmode, convert_to_mode (Pmode, exp, 1));
exp = convert_to_mode (Pmode, exp, 1);
return force_reg (Pmode, exp);
} }
/* Divide COUNTREG by SCALE. */ /* Divide COUNTREG by SCALE. */
...@@ -23624,9 +23618,7 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1, ...@@ -23624,9 +23618,7 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1,
? !sibcall_insn_operand (XEXP (fnaddr, 0), word_mode) ? !sibcall_insn_operand (XEXP (fnaddr, 0), word_mode)
: !call_insn_operand (XEXP (fnaddr, 0), word_mode)) : !call_insn_operand (XEXP (fnaddr, 0), word_mode))
{ {
fnaddr = XEXP (fnaddr, 0); fnaddr = convert_to_mode (word_mode, XEXP (fnaddr, 0), 1);
if (GET_MODE (fnaddr) != word_mode)
fnaddr = convert_to_mode (word_mode, fnaddr, 1);
fnaddr = gen_rtx_MEM (QImode, copy_to_mode_reg (word_mode, fnaddr)); fnaddr = gen_rtx_MEM (QImode, copy_to_mode_reg (word_mode, fnaddr));
} }
...@@ -31276,9 +31268,8 @@ ix86_expand_special_args_builtin (const struct builtin_description *d, ...@@ -31276,9 +31268,8 @@ ix86_expand_special_args_builtin (const struct builtin_description *d,
gcc_assert (target == 0); gcc_assert (target == 0);
if (memory) if (memory)
{ {
if (GET_MODE (op) != Pmode) op = force_reg (Pmode, convert_to_mode (Pmode, op, 1));
op = convert_to_mode (Pmode, op, 1); target = gen_rtx_MEM (tmode, op);
target = gen_rtx_MEM (tmode, force_reg (Pmode, op));
} }
else else
target = force_reg (tmode, op); target = force_reg (tmode, op);
...@@ -31322,9 +31313,8 @@ ix86_expand_special_args_builtin (const struct builtin_description *d, ...@@ -31322,9 +31313,8 @@ ix86_expand_special_args_builtin (const struct builtin_description *d,
if (i == memory) if (i == memory)
{ {
/* This must be the memory operand. */ /* This must be the memory operand. */
if (GET_MODE (op) != Pmode) op = force_reg (Pmode, convert_to_mode (Pmode, op, 1));
op = convert_to_mode (Pmode, op, 1); op = gen_rtx_MEM (mode, op);
op = gen_rtx_MEM (mode, force_reg (Pmode, op));
gcc_assert (GET_MODE (op) == mode gcc_assert (GET_MODE (op) == mode
|| GET_MODE (op) == VOIDmode); || GET_MODE (op) == VOIDmode);
} }
...@@ -31572,9 +31562,8 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, ...@@ -31572,9 +31562,8 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
mode1 = insn_data[icode].operand[1].mode; mode1 = insn_data[icode].operand[1].mode;
mode2 = insn_data[icode].operand[2].mode; mode2 = insn_data[icode].operand[2].mode;
if (GET_MODE (op0) != Pmode) op0 = force_reg (Pmode, convert_to_mode (Pmode, op0, 1));
op0 = convert_to_mode (Pmode, op0, 1); op0 = gen_rtx_MEM (mode1, op0);
op0 = gen_rtx_MEM (mode1, force_reg (Pmode, op0));
if (!insn_data[icode].operand[0].predicate (op0, mode0)) if (!insn_data[icode].operand[0].predicate (op0, mode0))
op0 = copy_to_mode_reg (mode0, op0); op0 = copy_to_mode_reg (mode0, op0);
...@@ -31605,11 +31594,7 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, ...@@ -31605,11 +31594,7 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
op0 = expand_normal (arg0); op0 = expand_normal (arg0);
icode = CODE_FOR_sse2_clflush; icode = CODE_FOR_sse2_clflush;
if (!insn_data[icode].operand[0].predicate (op0, Pmode)) if (!insn_data[icode].operand[0].predicate (op0, Pmode))
{ op0 = force_reg (Pmode, convert_to_mode (Pmode, op0, 1));
if (GET_MODE (op0) != Pmode)
op0 = convert_to_mode (Pmode, op0, 1);
op0 = force_reg (Pmode, op0);
}
emit_insn (gen_sse2_clflush (op0)); emit_insn (gen_sse2_clflush (op0));
return 0; return 0;
...@@ -31622,11 +31607,7 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, ...@@ -31622,11 +31607,7 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
op1 = expand_normal (arg1); op1 = expand_normal (arg1);
op2 = expand_normal (arg2); op2 = expand_normal (arg2);
if (!REG_P (op0)) if (!REG_P (op0))
{ op0 = force_reg (Pmode, convert_to_mode (Pmode, op0, 1));
if (GET_MODE (op0) != Pmode)
op0 = convert_to_mode (Pmode, op0, 1);
op0 = force_reg (Pmode, op0);
}
if (!REG_P (op1)) if (!REG_P (op1))
op1 = copy_to_mode_reg (SImode, op1); op1 = copy_to_mode_reg (SImode, op1);
if (!REG_P (op2)) if (!REG_P (op2))
...@@ -31863,11 +31844,7 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, ...@@ -31863,11 +31844,7 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
op0 = expand_normal (arg0); op0 = expand_normal (arg0);
icode = CODE_FOR_lwp_llwpcb; icode = CODE_FOR_lwp_llwpcb;
if (!insn_data[icode].operand[0].predicate (op0, Pmode)) if (!insn_data[icode].operand[0].predicate (op0, Pmode))
{ op0 = force_reg (Pmode, convert_to_mode (Pmode, op0, 1));
if (GET_MODE (op0) != Pmode)
op0 = convert_to_mode (Pmode, op0, 1);
op0 = force_reg (Pmode, op0);
}
emit_insn (gen_lwp_llwpcb (op0)); emit_insn (gen_lwp_llwpcb (op0));
return 0; return 0;
...@@ -32013,9 +31990,7 @@ addcarryx: ...@@ -32013,9 +31990,7 @@ addcarryx:
/* Generate CF from input operand. */ /* Generate CF from input operand. */
op1 = expand_normal (arg0); op1 = expand_normal (arg0);
if (GET_MODE (op1) != QImode) op1 = copy_to_mode_reg (QImode, convert_to_mode (QImode, op1, 1));
op1 = convert_to_mode (QImode, op1, 1);
op1 = copy_to_mode_reg (QImode, op1);
emit_insn (gen_addqi3_cc (op0, op1, constm1_rtx)); emit_insn (gen_addqi3_cc (op0, op1, constm1_rtx));
/* Gen ADCX instruction to compute X+Y+CF. */ /* Gen ADCX instruction to compute X+Y+CF. */
...@@ -32165,9 +32140,7 @@ addcarryx: ...@@ -32165,9 +32140,7 @@ addcarryx:
/* Force memory operand only with base register here. But we /* Force memory operand only with base register here. But we
don't want to do it on memory operand for other builtin don't want to do it on memory operand for other builtin
functions. */ functions. */
if (GET_MODE (op1) != Pmode) op1 = force_reg (Pmode, convert_to_mode (Pmode, op1, 1));
op1 = convert_to_mode (Pmode, op1, 1);
op1 = force_reg (Pmode, op1);
if (!insn_data[icode].operand[1].predicate (op0, mode0)) if (!insn_data[icode].operand[1].predicate (op0, mode0))
op0 = copy_to_mode_reg (mode0, op0); op0 = copy_to_mode_reg (mode0, op0);
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