This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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)));
  	    }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]