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

Re: 3.1 m68k/coldfire code gen problem!!

>2002-05-09  Andreas Schwab  <>
>	* config/m68k/ (tabljump+2): Use `move.w %0,%0' for sign
>	extending an address register.

1) The move.w from memory to the address register did the sign extension
   anyway so in this case the 'move.w %0,%0' is a no-op.

2) What about the case where ASM_RETURN_CASE_JUMP is defined?  You'll
   have to modify the definition to look at operands[0] to see if its
   an address register(m68kelf.h and 6 other files)

I suggest that you modify the defintion of ASM_RETURN_CASE_JUMP to
be(at least from m68kelf.h):

#define ASM_RETURN_CASE_JUMP(operands) 		\
  do {						\
    if (ADDRESS_REG_P (operands[0]))		\
      return "jmp %%pc@(2,%0:l)";		\
    if (TARGET_5200)				\
      return "ext%.l %0\;jmp %%pc@(2,%0:l)";	\
    else					\
      return "jmp %%pc@(2,%0:w)";		\
  } while (0)

Note that 'operands' is now a parameter to the macro.

Peter Barada                         
Wizard                                         781-852-2768 (direct)
WaveMark Solutions(wholly owned by Motorola)   781-270-0193 (fax)

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