mn10300 bugfix

Jeffrey A Law law@cygnus.com
Sat Feb 6 17:26:00 GMT 1999


If the output operand also appeared in the input operand for reload_insi,
then we would generate incorrect code.  It's easily solved by copying part
of the input operand to the scratch register first, then setting the output
operand to the right value.

        * mn10300.md (reload_insi): Do not earlyclobber the output operand.

Index: mn10300.md
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/config/mn10300/mn10300.md,v
retrieving revision 1.69
diff -c -3 -p -r1.69 mn10300.md
*** mn10300.md	1999/01/26 14:56:01	1.69
--- mn10300.md	1999/02/07 01:23:42
***************
*** 251,257 ****
  {
    if (XEXP (operands[1], 0) == stack_pointer_rtx)
      {
-       emit_move_insn (operands[0], XEXP (operands[1], 0));
        if (GET_CODE (XEXP (operands[1], 1)) == SUBREG
  	  && (GET_MODE_SIZE (GET_MODE (XEXP (operands[1], 1)))
  	      > GET_MODE_SIZE (GET_MODE (SUBREG_REG (XEXP (operands[1], 1))))))
--- 251,256 ----
***************
*** 260,269 ****
  				 SUBREG_REG (XEXP (operands[1], 1))));
        else
  	emit_move_insn (operands[2], XEXP (operands[1], 1));
      }
    else
      {
-       emit_move_insn (operands[0], XEXP (operands[1], 1));
        if (GET_CODE (XEXP (operands[1], 0)) == SUBREG
  	  && (GET_MODE_SIZE (GET_MODE (XEXP (operands[1], 0)))
  	      > GET_MODE_SIZE (GET_MODE (SUBREG_REG (XEXP (operands[1], 0))))))
--- 259,268 ----
  				 SUBREG_REG (XEXP (operands[1], 1))));
        else
  	emit_move_insn (operands[2], XEXP (operands[1], 1));
+       emit_move_insn (operands[0], XEXP (operands[1], 0));
      }
    else
      {
        if (GET_CODE (XEXP (operands[1], 0)) == SUBREG
  	  && (GET_MODE_SIZE (GET_MODE (XEXP (operands[1], 0)))
  	      > GET_MODE_SIZE (GET_MODE (SUBREG_REG (XEXP (operands[1], 0))))))
***************
*** 272,277 ****
--- 271,277 ----
  				 SUBREG_REG (XEXP (operands[1], 0))));
        else
  	emit_move_insn (operands[2], XEXP (operands[1], 0));
+       emit_move_insn (operands[0], XEXP (operands[1], 1));
      }
    emit_insn (gen_addsi3 (operands[0], operands[0], operands[2]));
    DONE;


More information about the Gcc-patches mailing list