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]

Patch to fix x86 output_move_double corrupting cc0


The x86 port has the naive belief that register to register and
register to memory moves don't modify cc0.  Unfortunately the port
has a habit of using add, dec, inc, sub, etc. when generating the
actual move.  One such function that does this is output_move_double
if the operand is a non-offsettable memory operand.

ChangeLog:

Mon Apr 12 22:29:56 EDT 1999  John Wehle  (john@feith.com)

	* i386.c (output_move_double): Assume that complex moves
	clobber cc0.

Enjoy!

-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/config/i386/i386.c.ORIGINAL	Mon Apr 12 22:09:28 1999
--- gcc/config/i386/i386.c	Mon Apr 12 22:31:31 1999
*************** output_move_double (operands)
*** 1082,1087 ****
--- 1082,1092 ----
    if (optype0 == RNDOP || optype1 == RNDOP)
      abort ();
  
+   /* Assume that complex moves clobber cc0.  */
+   if ( !(optype0 == REGOP || optype0 == OFFSOP)
+       || !(optype1 == REGOP || optype1 == CNSTOP || optype1 == OFFSOP))
+     CC_STATUS_INIT;
+ 
    /* If one operand is decrementing and one is incrementing
       decrement the former register explicitly
       and change that operand into ordinary indexing.  */
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------



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