This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix i386 conditonal moves
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at cygnus dot com
- Date: Sat, 7 Dec 2002 18:44:52 +0100
- Subject: Fix i386 conditonal moves
Hi,
my movcc changes uncovered another latent problem. ix86_expand_int_movcc
construct LEA with MULT instruction, however sometimes it builds just one
operation and then it emits the operation directly by adding clobber. This
does not work for single MULT that ought to be shift. In the early ifcvt pass
this does not matter byt in post-combine one it causes slow code.
It also breaks for QImode where there is no matching pattern.
OK for mainline?
Honza
Sat Dec 7 18:11:43 CET 2002 Jan Hubicka <jh@suse.cz>
* i386.c (ix86_expand_int_movcc): Use force_operand instead of constructing
insn directly.
Index: i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.446.2.7
diff -c -3 -p -r1.446.2.7 i386.c
*** i386.c 29 Nov 2002 22:49:06 -0000 1.446.2.7
--- i386.c 7 Dec 2002 17:12:02 -0000
*************** ix86_expand_int_movcc (operands)
*** 9532,9547 ****
if (!rtx_equal_p (tmp, out))
{
if (nops == 1)
! {
! rtx clob;
!
! clob = gen_rtx_REG (CCmode, FLAGS_REG);
! clob = gen_rtx_CLOBBER (VOIDmode, clob);
!
! tmp = gen_rtx_SET (VOIDmode, out, tmp);
! tmp = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, tmp, clob));
! emit_insn (tmp);
! }
else
emit_insn (gen_rtx_SET (VOIDmode, copy_rtx (out), copy_rtx (tmp)));
}
--- 9532,9538 ----
if (!rtx_equal_p (tmp, out))
{
if (nops == 1)
! out = force_operand (tmp, out);
else
emit_insn (gen_rtx_SET (VOIDmode, copy_rtx (out), copy_rtx (tmp)));
}