This is the mail archive of the gcc-bugs@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]

Re: m68k -mcpu32 current CVS crashes



> int f (unsigned int x){  return x/10;}

Please try the patch below.

This was broken on m68k by changing
   mulu.l #0xcccccccd,%d0:%d1
into
   mulu.l #-858993459,%d0:%d1
which indicates the same 32-bit number.  It is possible that some 68k
assemblers might not accept -858993459, but gas seems to and I suggest we
should just try to make it work for the sake of 64/32 bit compatibility.

If necessary we might put back some of the complicated printout
decisions that used to determine the radix and width of the printf
format in final.c or varasm.c.


  * config/m68k.c (const_uint32_operand): Accept negative const on 32-bit host.

*** m68k.c      2000/06/06 16:21:41     1.1
--- m68k.c      2001/03/03 14:36:59
*************** const_uint32_operand (op, mode)
*** 3332,3338 ****
    return (GET_CODE (op) == CONST_INT
          && (INTVAL (op) >= 0 && INTVAL (op) <= 0xffffffffL));
  #else
!   return ((GET_CODE (op) == CONST_INT && INTVAL (op) >= 0)
          || (GET_CODE (op) == CONST_DOUBLE && CONST_DOUBLE_HIGH (op) == 0));
  #endif
  }
--- 3332,3338 ----
    return (GET_CODE (op) == CONST_INT
          && (INTVAL (op) >= 0 && INTVAL (op) <= 0xffffffffL));
  #else
!   return ((GET_CODE (op) == CONST_INT)
          || (GET_CODE (op) == CONST_DOUBLE && CONST_DOUBLE_HIGH (op) == 0));
  #endif
  }




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